I have a select box with options in it. The value of the options gets the id of the item that is displayed in each option.
I do have an other value that should be linked on this option. Is there an easy way to do this?
<select id="category" name="data[cat]">
<option value="12" label="0">A</option>
<option value="7" label="0">B</option>
</select>
I tried to do this with entering the second value into a label attribute but then the problem is that I don't know the correct way to get the label value of the selected option. This is written in jQuery.
Ben kullanmak seçilen seçenek almak için:
$("#category").livequery('change', function () {
var catId = ($(this)[0].value);
});
This works great, but I just don't know how to get the label value of the selected option. Or maybe a better way to solve this problem.