Property Values

Property Values Description
autofocus Sets or returns whether a button should automatically get focused on page load.
defaultValue Sets or returns the default value of the button.
disabled Sets or returns whether the button is disabled or not.
form Returns a reference to the form that contains the button.
formAction Sets or returns the value of the formAction attribute of the button.
formEnctype Sets or returns the value of the formEnctype attribute of the button.
formMethod Sets or returns the value of the formMethod attribute of the button.
formNoValidate Sets or returns whether the button allows form data to be validated or not.
formTarget Sets or returns the value of the formTarget attribute of the button.
name Sets or returns the value of the name attribute of the submit button.
type Returns the form element type of the button.
value Sets or returns the value of the value attribute of the button.

HTML DOM button Object

The button object in HTML is used to represent a <button> element. The getElementById() method is used to get the button object.

Similar Reads

Property Values:

Property Values Description autofocus Sets or returns whether a button should automatically get focused on page load. defaultValue Sets or returns the default value of the button. disabled Sets or returns whether the button is disabled or not. form Returns a reference to the form that contains the button. formAction Sets or returns the value of the formAction attribute of the button. formEnctype Sets or returns the value of the formEnctype attribute of the button. formMethod Sets or returns the value of the formMethod attribute of the button. formNoValidate Sets or returns whether the button allows form data to be validated or not. formTarget Sets or returns the value of the formTarget attribute of the button. name Sets or returns the value of the name attribute of the submit button. type Returns the form element type of the button. value Sets or returns the value of the value attribute of the button....

Creating button object:

The button object can be created using JavaScript. The document.createElement() method is used to create

Accessing button object:

...

Supported Browsers:

Access the button object by using the getElementById() method. Put the id of the button element in the getElementById() to access it....

Contact Us