<scripttype="text/javascript">functionselcity(){vararr=[["--选择城市--"],["海定区","东城区","西城区","朝阳区"],["济南","青岛","日照","威海"],["长沙","郴州","岳阳","株洲"],["广州","深圳","惠州","东莞"]];varindex=document.getElementById("selID").selectedIndex;varsubNode=document.getElementById("subID");varcitys=arr[index];subNode.options.length=0;//清空之前选项for(varx=0;x<citys.length;x++){varoptNode=document.createElement("option");optNode.innerText=citys[x];subNode.appendChild(optNode);//选择添加到子选项中}}</script><styletype="text/css"></style></head><body><selectid="selID"onchange="selcity()"><option>--选择省市--</option><option>北京</option><option>山东</option><option>湖南</option><option>广东</option></select><selectid="subID"><option>--选择城市--</option></select></body>
700字范文,内容丰富有趣,生活中的好帮手!