I am new to the whole JavaScript and after banging my head for 3 days decided to ask for some help. I am trying to use the selectedindex function with a drop down menu that takes you to another page when click. This is what I have and cannot figured it out. Any help would be appreciated.
function infoMenu(infoMenu) {
var moreInfoSelect=infoMenu.moreInfo.selectedIndex
var moreInfoUrl=infoMenu.moreInfo.options[moreInfoSelect].value+”.html”
window.location=moreInfoUrl
}
<form id=”infoMenu” name=”infoMenu” method=”post” action=””>
<div align=”left”>
<select name=”moreInfo” onchange=”infoMenu(this.form)”>
<option value=”lab9-1solution”>Select an item</option>
<option value=”lab9-1artgallery”>Art Gallery</option>
<option value=”lab9-1giftshop”>Gift Shop</option>
<option value=”lab9-1cafe”>Art’s Cafe</option>
</select>
</div>
</form>