I need to get the value of selected dropdown and not the text. eg: IN for India in dropdown.
<select id="country">
<option val="IN">India</option>
<option val="CN">China</option>
<option val="AU">Australia</option></select>
<div id ="get"></div>
Script:
$("#get").text($("#country").val());
Please refer http://jsfiddle.net/yxMSK/3/
I am making a silly mistake somewhere but unable to find it. Plz help.
The HTML is wrong:
You need to replace val=”” with value=””