<select next="#city">
</select>
<select next="#county">
<option>==请选择市==</option>
</select>
</form>
<select>
<option>==请选择县==</option>
</select>
<script type="text/javascript">
$("#province,#city").change(function () {
var nextSelect = $(this.getAttribute("next"));
//if (nextSelect.size() > 0) {
nextSelect.find("option:gt(0)").remove();
var _id = $(this).find("option:selected").val();
var query = { parentId: _id };
$.get("/Handler.ashx", query, function (data, status) {
//...
nextSelect.append("<option>...</option>....");
});
//}
});
</script>
您可能感兴趣的文章: