<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">
最佳答案
关于html - 输入 onclick 新标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16786813/