Name

Button — an HTML <button>

Inherits from

Node, Element, FormControl

Synopsis

A Button object represents an HTML <button> element. Most of the properties and methods of Buttons are described in FormControl and Element. When a Button has a type property (see FormControl) “submit”, however, the other properties listed here specify form submission parameters that override similar properties on the Button’s form (see FormControl).

Properties

The following properties are meaningful only when the <button> has a type of “submit”.

string formAction

This property mirrors the formaction HTML attribute. For submit buttons, it overrides the action property of the form.

string formEnctype

This property mirrors the formenctype HTML attribute. For submit buttons, it overrides the enctype property of the form and has the same legal values as that property.

string formMethod

This property mirrors the formmethod HTML attribute. For submit buttons, it overrides the method property of the form.

string formNoValidate

This property mirrors the formnovalidate HTML attribute. For submit buttons, it overrides the noValidate property of the form.

string formTarget

This property mirrors the formtarget HTML attribute. For submit buttons, it overrides the target property of the form.

Get JavaScript: The Definitive Guide, 6th 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.