Option form attribute

Definition and Usage

form The property returns a reference to the form containing the options.

This property returns the form object on success.

See also:

HTML Reference Manual:HTML <option>-tag

Example

Return the id of the form that contains the <option> element with id="apple":

var x = document.getElementById("apple").form.id;

Prova själv

Syntax

optionObject.form

Tekniska detaljer

Returvärde:

Referens till formulärelement som innehåller alternativ.

Om alternativet inte finns i formuläret, returneras null.

Webbläsarstöd

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Stöd Stöd Stöd Stöd Stöd