HTML DOM Input Button Object
- Previous page <ins>
- Next page <input> checkbox
Input Button Object
The Input Button object represents the HTML <input> element with type="button" set.
Access Input Button Object
You can access the <input> element with type="button" using getElementById():
var x = document.getElementById("myBtn");
Tip:You can also search for the elements collection to access <input type="button">.
Create Input Button Object
You can create an <input> element with type="button" using the document.createElement() method:
var x = document.createElement("INPUT"); x.setAttribute("type", "button");
Input Button Object Properties
Attributes | Description |
---|---|
autofocus | Set or return whether the input button should automatically focus when the page is loaded. |
defaultValue | Set or return the default value of the input button. |
disabled | Set or return whether the input button is disabled. |
form | Return a reference to the form that contains the input button. |
name | Set or return the name attribute value of the input button. |
type | Return which type of form element the input button is. |
value | Set or return the value of the input button's value attribute. |
Standard attributes and events
The Input Button object supports both standardAttributesandEvents.
Related pages
HTML Tutorial:HTML Form
HTML Reference Manual:HTML <input> Tag
HTML Reference Manual:HTML <input> type Attribute
- Previous page <ins>
- Next page <input> checkbox