how do i get the dropdown rel=”30″ value?
<select id="t_dermal_name">
<option value="1" rel="30">Between Eyebrows</option>
<option value="7" rel="30">Individual Line Softening</option>
<option value="2" rel="30">Lip Contouring</option>
</select>
jquery:
$("#t_dermal_name").change(onSelectChange);
function onSelectChange(){
var selected = $("#t_dermal_name option:selected");
var output = "";
if(selected.val() != 0){
output = selected.rel();
}
$("#output").html(output);
}
You can use the
:selectedselector to find the selected option and retrieve itsrelvalue using theattr()method.Something like this: http://jsfiddle.net/yAQhq/