Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: jazdian
Added: Apr 6, 2018 5:13 PM
Views: 18
  1. // Select first option
  2. $('#MySelect>option:eq(0)').prop('selected', true);
  3.  
  4. // Select second option
  5. $('#MySelect>option:eq(1)').prop('selected', true);