Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: userc865b
Added: Mar 29, 2019 1:15 PM
Views: 6
Tags: jq
gets Text of select
  1. <select id="myselect">
  2.     <option value="1">Mr</option>
  3.     <option value="2">Mrs</option>
  4.     <option value="3">Ms</option>
  5.     <option value="4">Dr</option>
  6.     <option value="5">Prof</option>
  7. </select>
  8.  
  9. $( "#myselect" ).val();
  10. $( "#myselect option:selected" ).text();