Very simple question I hope.
I have the usual <select>
box like this
<select id="select">
<option value="1">this</option>
<option value="2">that</option>
<option value="3">other</option>
</select>
I can get the selected value (by using $("#select").val()
) and the selected item's display value (by using $("#select :selected").text()
.
But how can I store like an additional value in the <option>
tag? I would like to be able to do something like <option value="3.1" value2="3.2">other</option>
and get the value of the value2
attribute (which would be 3.2 in the example).
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…