jq操纵select

https://www.cnblogs.com/hailexuexi/p/6708110.html

<script>
gethangye();
function gethangye() {
$.ajax({
type: "post",
dataType: "json",
url : ""+getRootPath()+"/admin/pollutantSourType!getTree?pType=3",
success: function(resp){
var data = resp.data;
for(var i=0;i<data.length;i++){
var name=data[i].name;
var valueid=data[i].id
$("#industry1").append("<option value='" + valueid+ "'>" + name + "</option>");
}
},
error:function(){message_box.show('加载失败!', 'error');}
});
}
$("#industry1").change(function(){
var checkValue=$("#industry1").val(); //获取Select选择的Value
})
</script>
原文地址:https://www.cnblogs.com/chengyalin/p/10382067.html