HuyPV
Thursday, November 4, 2010
//html - form
<select id="s1" name="s1">
<option value="o1">Option 1</option>
<option value="o2">Option 2</option>
<option value="o3">Option 3</option>
</select>
//javascript - jQuery
var sv = $("#s1").val();
alert(sv + ' - ' + $("#s1 option[value='" +sv+ "']").text());
Title:
jQuery - Get selected option text
Description:
//html - form <select id="s1" name="s1"> <option value="o1">Option 1</option> <option ...
...
Rating:
4