How to change selected item in jQuery

This question already has an answer here:

Hi I wrote that html codes and I want change selected item by using jQuery

<select id="slc"> 
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>

I tried this but I can't change

$("#slc").val("2");

$("#slc").prop("selectedIndex", 1);

Answers 1

Related Articles