<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<select name="a" id="a" onchange="CreateOptions(this)">
<option value="1">广东省</option>
<option value="2">河北省</option>
</select>
市:<select name="b" id="b">
<option value="0"> </option>
</select>
<script>
function CreateOptions(o) {
var v = "广州市,惠州市";
if (document.getElementById("a").options[document.getElementById("a").selectedIndex].value == 2)
v = "沧州市,衡水市";
var arr = v.split(",");
var obj = document.getElementById("b");
obj.options.length = 0;
for (var i = 0; i < arr.length; i++) {
obj.options.add(new Option(arr[i], (i + 1)));
}
}
CreateOptions();
</script>
</body>
</html>
效果选择省会城市改变。