HTML DOM Button Object - W3Schools
Có thể bạn quan tâm
HTML DOM Button Object ❮ Previous Next ❯
Button Object
The Button object represents an HTML <button> element.
Access a Button Object
You can access a <button> element by using getElementById():
Example
var x = document.getElementById("myBtn"); Try it Yourself »Create a Button Object
You can create a <button> element by using the document.createElement() method:
Example
var x = document.createElement("BUTTON"); Try it Yourself »Button Object Properties
| 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 |
Standard Properties and Events
The Button object also supports the standard properties and events.
Related Pages
HTML reference: HTML <button> tag
❮ Previous Next ❯ ★ +1 Sign in to track progressTừ khóa » Html Button Properties Javascript
-
HTML Button Tag - W3Schools
-
The Button Element - HTML: HyperText Markup Language | MDN
-
HTMLButtonElement - Web APIs | MDN
-
JavaScript Programmatically Create An HTML Button
-
HTML | DOM Button Object - GeeksforGeeks
-
Button Object JavaScript - Dottoro Web Reference
-
Learn Attributes Of HTML Button Tag - EduCBA
-
Button Type In HTML: Here's Why You Should Always Declare It »
-
Types And Styles In JavaScript Button Control - Syncfusion
-
Create Dynamic HTML Button Element With JavaScript/jQuery
-
HTML Button Hidden Attribute - Dofactory
-
HTML Button Id Attribute - Dofactory
-
HTML DOM Button Object - Javascript Reference
-
HTML DOM Button Type Property - W3Schools