HTML <버튼> formtarget 속성
예시
두 개의 제출 버튼이 있는 양식입니다. 첫 번째 제출 버튼은 기본 대상("_self")이 있는 양식 데이터를 제출하고 두 번째 버튼은 새 창(target="_blank")에 양식 데이터를 제출합니다.
<form action="/action_page.php" method="get">
<label for="fname">First name:</label>
<input type="text" id="fname"
name="fname"><br><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname"><br><br>
<button type="submit" >Submit</button>
<button type="submit" formtarget="_blank">Submit to a new window</button>
</form>
정의 및 사용
속성 은 formtarget
양식을 제출한 후 응답을 표시할 위치를 지정합니다. 이 속성은 양식의 속성을 재정의 target
합니다.
속성은 가 있는 formtarget
버튼에만 사용됩니다
type="submit"
.
브라우저 지원
표의 숫자는 속성을 완전히 지원하는 첫 번째 브라우저 버전을 지정합니다.
Attribute | |||||
---|---|---|---|---|---|
formtarget | 9.0 | 10.0 | 4.0 | 5.1 | 10.6 |
통사론
<button type="submit" formtarget="_blank|_self|_parent|_top|framename">
속성 값
Value | Description |
---|---|
_blank | Loads the response in a new window/tab |
_self | Loads the response in the same frame (this is default) |
_parent | Loads the response in the parent frame |
_top | Loads the response in the full body of the window |
framename | Loads the response in a named iframe |
❮ HTML <버튼> 태그