HTML <버튼> 유형 속성
예시
하나의 제출 버튼과 하나의 재설정 버튼 역할을 하는 두 개의 버튼 요소(양식에서):
<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" value="Submit">Submit</button>
<button type="reset" value="Reset">Reset</button>
</form>
정의 및 사용
type
속성은 버튼 유형을 지정합니다 .
팁: 항상
<button>
요소의 유형 속성을 지정하십시오.
<button>
브라우저마다 요소 에 대해 다른 기본 유형을 사용할 수 있습니다 .
브라우저 지원
Attribute | |||||
---|---|---|---|---|---|
type | Yes | Yes | Yes | Yes | Yes |
통사론
<button type="button|submit|reset">
속성 값
Value | Description |
---|---|
button | The button is a clickable button |
submit | The button is a submit button (submits form-data) |
reset | The button is a reset button (resets the form-data to its initial values) |
❮ HTML <버튼> 태그