11.12.2012 Views

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}<br />

//-->><br />

alert(msg);<br />

<br />

<br />

<br />

Option 1<br />

Option 2<br />

Option 3<br />

Option 4<br />

Option 5<br />

<br />

<br />

<br />

Now that we‘ve covered how to access options in a select menu, let‘s take a look at the<br />

properties of the Option element itself. <strong>The</strong>se objects have most of the attributes and methods<br />

of other form elements, plus those listed in Table 14-11.<br />

Table 14-11: Additional Properties of the HTMLOptionElement Object<br />

Property Description<br />

defaultSelected Boolean indicating if this option is selected by default (i.e., whether<br />

the tag had attribute selected).<br />

index Number indicating the slot at which this option can be found in its<br />

containing Select's options[] collection.<br />

selected Boolean indicating if this option is currently selected.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!