Latest web development tutorials

HTML DOM Select form properties

Select Object Reference Select Objects

Definition and Usage

form property returns to the form element that contains the drop-down list of references.

This property returns the form object.

grammar

selectObject.form


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support form properties


Examples

Examples

Form displays a drop-down list id:

<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
function displayResult () {
var x = document.getElementById ( "mySelect") form.id.;
alert (x);
}
</ Script>
</ Head>
<Body>

<Form id = "form1">
Choose your favorite fruit:
<Select id = "mySelect">
<Option> Apple </ option>
<Option> Orange </ option>
<Option> Pineapple </ option>
<Option> Banana </ option>
</ Select>
</ Form>
<Button type = "button" onclick = "displayResult ()"> display belongs to the form ID </ button>

</ Body>
</ Html>

try it"


Select Object Reference Select Objects