您现在的位置: 圆点视线 >> 教程 >> 网页设计 >> html教程 >> 文章正文
连动下拉菜单         
连动下拉菜单
作者:icech  文章来源:西部E网  点击数:  更新时间:2005-7-23 20:30:19 
 页面功能:【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口 【字体:

<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" onChange="changelocation(document.myform.biglocation.options[document.myform.biglocation.selectedIndex].value)">
        <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>

 【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 文章录入:apoints    责任编辑:apoints  【字体:
 
  • 上一篇文章:

  •  
  • 下一篇文章:
  • 最新文章
    相关文章
    DW MX实例:多彩文字链接
    自定多姿多彩的网页链接下划线
    改变字体而不影响网页
    网站鼠标变变变!
    如何在网页中制作虚线表格
    为你的网页链接加上快捷键
    给你的网页加上两种以上的文字链接效果
    从三个方面提高网站的链接广泛度
    网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    发表评论:
     姓  名: 评 分: 1分 2分 3分 4分 5分
     评论内容: ·严禁发表危害国家安全、政治、黄色淫秽等内容的评论。
    ·用户需对自己在使用本网服务过程中的行为承担法律责任
    ·本站管理员有权保留或删除评论内容。
    ·评论内容只代表机友个人观点,与本网站立场无关。
     
    最 新 推 荐
     
    百度主题推广
    最 新 热 门