JQuery with HTML SELECT option

From CoderLearner
Jump to: navigation, search

Description

How to select the SELECT element option in JQUERY.

Example 1

  • HTML SELECT Element
<form class="frmUser">
  <select>
    <option value="val1">Val 1</option>
    <option value="val2">Val 2</option>
    <option value="val3">Val 3</option>
  </select>
</form>
  • Select by value
  $('.frmUser').find('select').val('val1');