How to set the selected option of a select list by value NOT by selectedIndex using jQuery? -
i trying set selected item of select equals value. using:
$("#myselectlist").val(4);
this setting list 4th selectedindex instead of selectedindex has value of 4.
i using version 1.9.1. help!
try this:
$("#myselectlist option[value='4']").prop('selected', true);
Comments
Post a Comment