I am trying to create a script that will have a drop down menu and will load the web page selected .
For some reason my function doesnot load the web page selected on the drop down menu What i am doing wrong here?
Any help will be appreciated
This is the function :
function loadPage(){
var sel_idx = document.demo.menu.selectedIndex
var urlToLoad = document.demo.menu.options[sel_idx].value
location.href = urlToLoad
}
This is the code:
<FORM NAME="demo">
<SELECT NAME="menu" onChange="loadPage()">
<OPTION VALUE="default2.htm">web1
<OPTION VALUE="les.htm">web2
<OPTION SELECTED VALUE="Default.htm">web3
<OPTION VALUE="webpage4.htm">web4
<OPTION VALUE="webpage5.htm">web5
</SELECT>
</FORM>