HTML Drop Down

<select id="DropDownList" >
  <option value="1">One</option>
  <option value="2">Two</option>
  <option value="3">Three</option>
</select>

Set value using

var theText = "Three";
$("#DropDownList option:contains(" + theText + ")").attr('selected', 'selected');
Last modified: April 28, 2019

Author

Comments

Write a Reply or Comment