I am developing a web app. I used form as a drop down menu so that it displays the information about the category users selected. But when I select an option the link is opening in new window. I want it to open in the same window. I used target attribute with form like this
<form id="aform" target="_self">
<select id="mymenu">
<option selected>Choose a category</option>
<option value="moblist.html" target="self">Mobiles</option>
<option value="" >Tablets</option>
<option value="">Laptops</option>
<option value="">Bikes</option>
<option value="">Car</option>
</select>
</form>
my java scrip is
var selectmenu=document.getElementById("mymenu")
selectmenu.onchange=function(){ //run some code when "onchange" event fires
var chosenoption=this.options[this.selectedIndex] //this refers to "selectmenu"
if (chosenoption.value!="nothing"){
window.open(chosenoption.value, "", "") //open target site (based on option's value attr) in new window
}
}
but still the link is opening in new window. How can I make the selected page to open in the same window.