• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

连动下拉菜单_html

html 搞代码 7年前 (2018-06-15) 165次浏览 已收录 0个评论

<html>
<head>
<title>List</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″>
<script LANGUAGE=”JavaScript“>
<!–
var onecount;
onecount=0;
   
subcat = new Array();
subcat[0] = new Array(“徐汇区”,”01″,”001″);
subcat[1] = new Array(“嘉定区”,”01″,”002″);
subcat[2] = new Array(“黄浦区”,”01″,”003″);
subcat[3] = new Array(“南昌市”,”02″,”004″);
subcat[4] = new Array(“九江市”,”02″,”005″);
subcat[5] = new Array(“上饶市”,”02″,”006″);

onecount=6;

function changelocation(locationid)
    {
    document.myform.smalllocation.length = 0;

    var locationid=locationid;
    var i;
    document.myform.smalllocation.options[0] = new Option(‘====所有地区====’,”);
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            {
            document.myform.smalllocation.options[document.myform.smalllocation.length] = new Option(subcat[i][0], subcat[i][2]);
            }       
        }
       
    }   

//–>
</script>
</head>
<body>
<form name=”myform” method=”post”>
    <select name=”biglocation” >
        <option value=”01″ selected>上海</option>
        <option value=”02″>江西</option>
    </select>
    <select name=”smalllocation”>
        <option selected value=””>==所有地区==</option>
    </select>
</form>
<script LANGUAGE=”javascript”>
<!–
    changelocation(document.myform.biglocation.options[document.myform.biglocation.selectedIndex].value);

//–>
</script>
</body>
</html>

http://www.gaodaima.com/32568.html连动下拉菜单_html

欢迎大家阅读《连动下拉菜单_html》,跪求各位点评,若觉得好的话请收藏本文,by 搞代码


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:连动下拉菜单_html
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址