HTML DOM 버튼 객체
버튼 개체
Button 개체는 HTML <button> 요소를 나타냅니다.
버튼 개체에 액세스
getElementById()를 사용하여 <button> 요소에 액세스할 수 있습니다.
예시
var x = document.getElementById("myBtn");
버튼 객체 생성
document.createElement() 메서드를 사용하여 <button> 요소를 만들 수 있습니다.
예시
var x = document.createElement("BUTTON");
버튼 개체 속성
Property | Description |
---|---|
autofocus | Sets or returns whether a button should automatically get focus when the page loads, or not |
disabled | Sets or returns whether a button is disabled, or not |
form | Returns a reference to the form that contains a button |
formAction | Sets or returns the value of the formaction attribute of a button |
formEnctype | Sets or returns the value of the formenctype attribute of a button |
formMethod | Sets or returns the value of the formmethod attribute of a button |
formNoValidate | Sets or returns whether the form-data should be validated or not, on submission |
formTarget | Sets or returns the value of the formtarget attribute of a button |
name | Sets or returns the value of the name attribute of a button |
type | Sets or returns the type of a button |
value | Sets or returns the value of the value attribute of a button |
표준 속성 및 이벤트
Button 객체는 표준 속성 과 이벤트 도 지원합니다 .
관련 페이지
HTML 참조: HTML <button> 태그