Skip navigation

<label>Combo box: </label>
<select name="selState" id="selState">
   <option value="TN">Tamilnadu</option>
   <option value="AP">AndraPradesh</option>
document.forms[0].selState.options[0]  //<option value="TN">
document.forms[0].selState.options[0].getAttribute("value")  //"TN"
document.forms[0].selState.options[0].firstChild.nodeValue  //"Tamilnadu"
document.forms[0].selState.options[0].text  //Tamilnadu
document.forms[0].selState.options[0].value   //TN
document.forms[0].selState.options[1].index   //1
document.forms[0].selState.options.length   //2
document.forms[0].selState.selectedIndex   //index of currently selected option

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: