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

HTML DOM Button form Property

Button form Property

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 property.


Example

Example

The following example returns the id of the form to which the button belongs:

Runoob Tutorial(runoob.com)

The ID of the form containing the button:

Try it »


Button Object Reference Button Object