How do I make the first option of selected with jQuery?

<select id="target">
  <option value="1">...</option>
  <option value="2">...</option>
</select>

28 s
28

$("#target").val($("#target option:first").val());

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *