Let's assume you have the following HTML5
<select id="example">
<option value="AA" data-id="143">AA</option>
<option value="BB" data-id="344">BB</option>
</select>
$("#example").select2();
How do I get the data-id from the selected option ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…