<option value="33333" data-socketid="1111" data-numnew="22222">4444</option>
$(document).on('change', '#institute-select', function () { // 这里是重点,使用attr来获取 var id = $(this).find("option:selected").attr('data-id'); console.log('id = ' + id) });
标签:JQuery,attr,data,id,select,option From: https://www.cnblogs.com/741570hh/p/17861227.html