Selecting a specific value in a SELECT element through jQuery.

vishalneeraj-24503
Posted by vishalneeraj-24503 under jQuery category on | Points: 40 | Views : 295
<div class = "select">
<select class = "opts">
<option selected value = "Default">Default</option>
<option value = "opt1">Val 1</option>
<option value = "opt2">Val 2</option>
</select>
</div>


For an index:-
$('.select option[value="opt1"]')


For a known text:-
$('.select option:eq(1)')

Comments or Responses

Login to post response