<html>
<head>
<title>ChangeCity--省份--城市</title>
<script type="text/javascript">
    function changeCity(){
        //得到省份 名字
        //new Option("显示的值", "value值")
        var Sname = document.getElementById("shengf").value;
        var option1 , option2, option3;
        switch(Sname){
            case "江西省":
                option1 = new Option("南昌","南昌");
                option2 = new Option("九江","九江");
                option3 = new Option("抚州","抚州");
                break;
            case "四川省":
                option1 = new Option("重庆","重庆");
                option2 = new Option("成都","成都");
                option3 = new Option("汶川","汶川");
                break;   
            case "浙江省":
                option1 = new Option("杭州","杭州");
                option2 = new Option("宁波","宁波");
                option3 = new Option("温州","温州");
                break;   
            case "广东省":
                option1 = new Option("广东","广东");
                option2 = new Option("广州","广州");
                option3 = new Option("佛山","佛山");
                break;
            default:
                break;       
       
        }
        //清空city 列表-----再把值加进去
        //options:代表下拉框的选项数组
        document.getElementById("City").options.length = 0;
        document.getElementById("City").options.add(option1);
        document.getElementById("City").options.add(option2);
        document.getElementById("City").options.add(option3);  
   
    }
</script>
</head>
<body>
    省份:
    <select id="shengf" onchange="changeCity()">
        <option>---请选择省份---</option>;
        <option value="江西省">江西省</option>
        <option value="四川省">四川省</option>
        <option value="浙江省">浙江省</option>
        <option value="广东省">广东省</option>
    </select>
    城市:
    <select id="City">
        <option>---请选择城市---</option>;
    </select>
</body>
</html>