Wednesday, February 16, 2011

Javascript: Drop down list onchange

HTML select tag with onchange action.

Example:
<select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
<option value="">Choose a destination...</option>
<option value="http://www.yahoo.com/">YAHOO</option>
<option value="http://www.google.com/">GOOGLE</option>
<option value="http://www.altavista.com/">ALTAVISTA</option>
<option value="http://www.amazon.com/">AMAZON</option>
<option value="http://artlung.com/">ARTLUNG</option>
</select>

Refer site:
http://www.htmlcodetutorial.com/forms/_INPUT_onChange.html
http://lab.artlung.com/dropdown/
http://www.pageresource.com/jscript/jdrop2.htm
 

No comments:

Post a Comment