我在網站中做了一個帶有鏈接的下拉菜單,但是當我選擇該項目並點擊開始時,它不會在任何地方重定向。你能分享下面的代碼中的錯誤嗎?如何使用鏈接進行下拉菜單
<script>
function goToNewPage(dropdownlist){
var url = dropdownlist.options(dropdownlist.selectedIndex).value;
if (url != ""){
window.open(url);
}}
</script>
<form name="dropdown">
<label>I am Looking for</label><img src="http://test.techkalph.com/wp-content/uploads/2015/10/Bee-searching1.png">
<select name="list" accesskey="E">
<option selected>Please select one</option>
<option value="http://www.google.com/" style="background-image:url(http://test.techkalph.com/wp-content/uploads/2015/10/flowers271.png); background-repeat:no-repeat;">Japanese Companies</option>
<option value="http://www.google.com/" style="background-image:url(http://test.techkalph.com/wp-content/uploads/2015/10/social16.png); background-repeat:no-repeat;">Service Provider (Non-Japanese)</option>
<select>
<input type=button value="Go" onclick="goToNewPage(document.dropdown.list)">
</form>
期待您的回覆。
謝謝。