I want to retrieve group text of my drop down in variable and then assign to a textbox named “txtRegion”
<select id="cmbCity" name="cmbCity" multiple="multiple">
<option group='Andaman & Nicobar Islands|NORTH' value='1' >Port Blair</option>
</select>
I have tried following code but doesnt seem to be work
$("#cmbCity").change(function() {
var n = $("#cmbCity").attr('group').text();
alert(n);
});
1 Answer