Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Input Button form attribute

Input Button form attribute

Button Object Reference Button Object


Definition and Usage

The form attribute returns a reference to the form that contains the button.

If the button is contained in a form, a form object is returned; otherwise null is returned.

Syntax

buttonObject.form


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the form attribute


Example

Example

The following example returns the id of the form that contains the button:

Runoob Tutorial(runoob.com)

Try it »


Button Object Reference Button Object