<html>
<head>
<script type="text/javascript">
window.addEventListener("load",go,false);
function go()
{
var e = document.getElementById("dropdown");
e.addEventLisnter("change",trigger,false);
}
function trigger(e)
{
var url = e.option[e.selectedIndex].value;
window.open(url);
window.confirm("url successfull open");
}
</script>
</head>
<body>
<form action="#">
<select id="dropdown">
<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>
</form>
</body>
</html>
i have visited many sites to find the solution for the code,my program is helping the user to open anew window once they selected the dropdown menu. i found out the syntax dealing with dropbox is selectedIndex and option. but when i apply it, it wouldn't function at all,can i know where is my mistake ?
my reference link
Get selected value in dropdown list using JavaScript?
http://lab.artlung.com/dropdown/
jquery,onchange method are not allowed, it must use javascript and addEventListener