jquery 获得select下拉框选择中的属性值

在平常做项目中经常遇到索性记录下来;

$("#ZJshi").bind("change",function(){ //监听select改变
var miaoshu = $(this).val();//获得选中的值
var data_orgcoding = $(this).find("option:selected").attr("data_orgcoding");//主要就是这句话获取自定义属性的

$('.Zjxian_option,.ZJbuMeng_option').siblings().remove();
    getQuYuList1(data_orgcoding,'#Zjxian')
});
原文地址:https://www.cnblogs.com/zou1234/p/7867720.html