直接复制到txt里 然后把txt后缀修改成html 直接运行
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var arrItems1 = new Array();
var arrItemsGrp1 = new Array();arrItems1[3] = "Truck";
arrItemsGrp1[3] = 1;
arrItems1[4] = "Train";
arrItemsGrp1[4] = 1;
arrItems1[5] = "Car";
arrItemsGrp1[5] = 1;arrItems1[6] = "Boat";
arrItemsGrp1[6] = 2;
arrItems1[7] = "Submarine";
arrItemsGrp1[7] = 2;arrItems1[0] = "Planes";
arrItemsGrp1[0] = 3;
arrItems1[1] = "Ultralight";
arrItemsGrp1[1] = 3;
arrItems1[2] = "Glider";
arrItemsGrp1[2] = 3;var arrItems2 = new Array();
var arrItemsGrp2 = new Array();arrItems2[21] = "747";
arrItemsGrp2[21] = 0
arrItems2[22] = "Cessna";
arrItemsGrp2[22] = 0arrItems2[31] = "Kolb Flyer";
arrItemsGrp2[31] = 1
arrItems2[34] = "Kitfox";
arrItemsGrp2[34] = 1arrItems2[35] = "Schwietzer Glider";
arrItemsGrp2[35] = 2arrItems2[99] = "Chevy Malibu";
arrItemsGrp2[99] = 5
arrItems2[100] = "Lincoln LS";
arrItemsGrp2[100] = 5
arrItems2[57] = "BMW Z3";
arrItemsGrp2[57] = 5arrItems2[101] = "F-150";
arrItemsGrp2[101] = 3
arrItems2[102] = "Tahoe";
arrItemsGrp2[102] = 3arrItems2[103] = "Freight Train";
arrItemsGrp2[103] = 4
arrItems2[104] = "Passenger Train";
arrItemsGrp2[104] = 4arrItems2[105] = "Oil Tanker";
arrItemsGrp2[105] = 6
arrItems2[106] = "Fishing Boat";
arrItemsGrp2[106] = 6arrItems2[200] = "Los Angelas Class";
arrItemsGrp2[200] = 7
arrItems2[201] = "Kilo Class";
arrItemsGrp2[201] = 7
arrItems2[203] = "Seawolf Class";
arrItemsGrp2[203] = 7function selectChange(control, controlToPopulate, ItemArray, GroupArray)
{
  var myEle ;
  var x ;
  // Empty the second drop down box of any choices
  for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
  if (control.name == "firstChoice") {
    // Empty the third drop down box of any choices
    for (var q=myChoices.thirdChoice.options.length;q>=0;q--) myChoices.thirdChoice.options[q] = null;
 }
  // ADD Default Choice - in case there are no values
  myEle = document.createElement("option") ;
  myEle.value = 0 ;
  myEle.text = "[SELECT]" ;
  controlToPopulate.add(myEle) ;
for ( x = 0 ; x < ItemArray.length  ; x++ )
    {
      if ( GroupArray[x] == control.value )
        {
          myEle = document.createElement("option") ;
          myEle.value = x ;
          myEle.text = ItemArray[x] ;
          controlToPopulate.add(myEle) ;
        }
    }
}
//  End -->
</script>
<form name=myChoices>
<table align="center">
<tr>
<td>
<SELECT id=firstChoice name=firstChoice onchange="selectChange(this, myChoices.secondChoice, arrItems1, arrItemsGrp1);">
    <option value=0 SELECTED>[SELECT]</option>
    <option value=1>Land</option>
    <option value=2>Sea</option>
    <option value=3>Air</option>
</SELECT>
</TD><TD>
<SELECT id=secondChoice name=secondChoice onchange="selectChange(this, myChoices.thirdChoice, arrItems2, arrItemsGrp2);">
</SELECT>
<SELECT id=thirdChoice name=thirdChoice>
</SELECT>
</TD>
</TR>
</TABLE>
</form><a href="http://www.alixixi.com/Dev/HTML/jsrun/">欢迎访问阿里西西网页特效集</a>

解决方案 »

  1.   

    <form action="" method="post">
    <script>
    <!--
    <%
    '二级数据保存到数组
    Dim count1,cityRS,citySQL
    set cityRS=server.createobject("adodb.recordset")
    citySQL="select * from city order by shiorder" 
    cityRS.open citySQL,conn,1,1
    %>
    var subval2 = new Array();
    //数组结构:一级根值,二级根值,二级显示值
    <%
    count1 = 0
    do while not cityRS.eof
    %>
    subval2[<%=count1%>] = new Array('<%=cityRS("Shengid")%>','<%=cityRS("id")%>','<%=cityRS("shiname")%>')
    <%
    count1 = count1 + 1
    cityRS.movenext
    loop
    cityRS.close
    %>
    function changeselect1(locationid)
    {
        document.form1.city.length = 0;
        document.form1.city.options[0] = new Option('请选择城市','');
        for (i=0; i<subval2.length; i++)
        {
            if (subval2[i][0] == locationid)
            {document.form1.city.options[document.form1.city.length] = new Option(subval2[i][2],subval2[i][1]);}
        }
    }
    //-->
            </script>
    <select name="province" class="buttonmain" id="province" onChange="changeselect1(this.value)">
    <option value="">请选择省份</option>
    <%
    dim provinceRS,provinceSQL
    set provinceRS = server.createobject("adodb.recordset")
    provinceSQL = "select * from province order by shengorder"
    provinceRS.open provinceSQL,conn,1,1
    do while not provinceRS.eof
      if provinceRS("id") = province then
         response.Write "<option value="&provinceRS("id")&" selected>"&provinceRS("shengname")&"</option>"
      else
         response.Write "<option value="&provinceRS("id")&">"&provinceRS("shengname")&"</option>"
      end if
      
    provinceRS.movenext
    loop
    provinceRS.close
    set provinceRS = nothing
    %>
            </select>
              <select name="city" class="buttonmain" id="city">
      <option value="">请选择城市</option>
              </select> 
    </form >
      

  2.   

    select.options.add( new Option(name,value));
      

  3.   

    这有两个:
    http://www.t6new.cn/feature/location.html一个取自:discuz,一个在我在网上找的
      

  4.   

    这个可以
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html>
    <head>
    <title>Untitled</title>
    <script>
    var arr = [
    ['北京','东城区'],
    ['北京','西城区'],
    ['北京','崇文区'],
    ['上海','黄浦区'],
    ['上海','卢湾区'],
    ['上海','徐汇区'],
      ]
    function funcChange(){
         var f = document.forms[0];
         var strProvince = f.selProvince.value;
            f.selCity.options.length = 0;
         for(var i=0;i<arr.length;i++){
         var array = arr[i];
         if(array[0] == strProvince){
         var option = document.createElement("option");
    option.text = array[1];
    option.value = array[1];
    var length = f.selCity.options.length;
    f.selCity.options[length]=option;
         }
         }
        }
    </script>
    </head><body>
    <form>
    <select name="selProvince" onChange="funcChange()">
    <option value="">请选择省份</option>
    <option value="北京">北京</option>
    <option value="上海">上海</option>
    </select>
    &nbsp;&nbsp;
    <select name="selCity">
    <option value="">请选择城市</option>
    </select>
    </form>
    </body>
    </html>
      

  5.   

    http://download.csdn.net/source/703171/这是写好的例子 ,,你下载下来就行了