25.2. The Button Object

The Button object corresponds to form elements created through <INPUT TYPE="BUTTON" ...>. Most of its characteristics are shared by elements created through <INPUT TYPE="SUBMIT" ...> and <INPUT TYPE="RESET" ...>.

However, SUBMIT and RESET buttons have more specific types: Submit and Reset, respectively. A Button is typically accessed either through the elements array of the corresponding Form or, if both the form and the button are named, through document.formName.buttonName.

Properties

form This read-only property gives the Form object containing the button.

name If the button used the NAME attribute, this read-only property retrieves it.

type For pure Button objects, this property is always equal to button. For SUBMIT ...

Get Core Web Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.