<select id="touchsplashmenu" onchange="window.open(this.value,'','');">
<option value="">Choose your page</option>
<option value="page1.html">Page 1</option>
<option value="page2.html">Page 2</option>
<option value="page3.html">Page 3</option>
</select>
现在每个页面都会在新窗口中打开。如何更改此设置以便在当前浏览器窗口中打开页面?
答案 0 :(得分:1)
这对你有用吗?
<select id="touchsplashmenu" onchange="location.href=this.value">
<option value="">Choose your page</option>
<option value="www.google.com">Page 1</option>
<option value="www.facebook.com">Page 2</option>
<option value="www.google.com">Page 3</option>
</select>
答案 1 :(得分:1)
<强>替换强>
onchange="window.open(this.value,'','');"
。通过强>
onchange="window.open(this.value,'_self');"
此外,如果您在“选择页面”上获得404页面...请尝试将其设置为value="#"
更新HTML
<select id="touchsplashmenu" onchange="window.open(this.value,'_self');">
<option value="#">Choose your page</option>
<option value="page1.html">Page 1</option>
<option value="page2.html">Page 2</option>
<option value="page3.html">Page 3</option>
</select>
答案 2 :(得分:0)