Js作下拉菜单跳转

来源:互联网 发布:电脑机器码查询软件 编辑:程序博客网 时间:2024/05/11 14:08
<script language="javascript">
function  browse(form ,i)
{
var site=form.elements[i].selectedIndex;
if($site>0)
{
   top.location=form.elements[i].options[site].value;
}
}
</script>
下拉菜单是:          
<select onChange="if(this.selectedIndex>0)location.href=this.options[this.selectedIndex].value">
<option value="請選擇" selected>全部列表</option>
<option value="http://blog.csdn.net/JOE4011/index.aspx?area=台北">台北</option>
<option value="http://blog.csdn.net/JOE4011/index.aspx?area=桃园">桃園</option>
</select>