关于下拉列表响应url

js:
<script>


function oc(){
var sel=document.getElementById("ls");
document.location=sel.options[sel.selectedIndex].value;
//window.open(sel.options[sel.selectedIndex].value,"_blank");//以新窗口
}
</script>

html:
 
 <select id="ls" onChange="oc();">
     <option value="url">说明</option>
 </select>

ps:
 onclick="javascript:window.location.href='URL'"
     onclick="location='URL'"
    onclick="window.location.href='URL?id=11'"
top.mainframe.frames['right_frame'].location

猜你喜欢

转载自blog.csdn.net/qin_shi/article/details/23957703