【发布时间】:2013-05-23 02:45:54
【问题描述】:
<form name="test">
<select name="choose" style="width:300px;">
<option selected="">Select option</option>
<option value="http://url.com">Test</option>
</select>
<input onclick="location=document.test.choose.options[document.test.choose.selectedIndex].value;" value="Take me there!" type="button"></p>
</form>
我正在使用以下内容制作下拉列表,只是想知道如何在新选项卡中而不是在其自己的窗口中打开选定选项
工作正常,因为它只需要在新标签页中打开。
* 编辑 *
这在需要时起作用了,谢谢
<input onClick="window.open(document.test.choose.options[document.test.choose.selectedIndex].value);" value="Take me there!" type="button">
【问题讨论】:
-
target="_blank" 在标签页而不是新窗口中打开页面
-
with html 我使用 target="_blank" 不知道如何在你的情况下应用它