I am using a HTML code to create a drop down menu for my site. The menu shows like this: The problem is when I select any of the menu, suppose say select "store" a new popup page will open. I want the page to be open in the same window. Can anyone tell me how to change the code to open select page (as url) to be open in the same window. My current code is: <html> <head> </head> <body> <select name="menu1" id="menu1"> <option value="http://example.com/quiz/">QUIZ</option> <option value="http://example.com/ihost">UploadDownload</option> <option value="http://example.com/store/">Store</option> <option value="http://example.com/index.php?app=arcade">FlashGames</option> <option value="http://example.com/blogs/">Blog</option> <option value="http://example.com/membermap/">BDMAP</option> </select> <script type="text/javascript"> var urlmenu = document.getElementById( 'menu1' ); urlmenu.onchange = function() { window.open( this.options[ this.selectedIndex ].value ); }; </script> </body> </html> HTML:
Try this? <body> <select name="menu1" id="menu1" onchange="location.href=this.options[this.selectedIndex].value"> <option value="http://example.com/quiz/">QUIZ</option> <option value="http://example.com/ihost">UploadDownload</option> <option value="http://example.com/store/">Store</option> <option value="http://example.com/index.php?app=arcade">FlashGames</option> <option value="http://example.com/blogs/">Blog</option> <option value="http://example.com/membermap/">BDMAP</option> </select> </body> HTML: