0

i have this select

 <select id="health">
     <option value=0>Select</option>
     <option value="1">Green</option>
     <option value="2">Amber</option>
     <option value="3">Red</option>
   </select>

i need to use jquery to get the content each opent for example Green or Amber etc .. i want want when the user sent a the value the option , he will get the content this option

  • 1
    https://stackoverflow.com/questions/14976495/get-selected-option-text-with-javascript – FireFighter Apr 21 '21 at 14:59
  • 1
    jquery solution - `$('#health').on('change', function() { console.log($(this).find('option:selected').text()); });` – s.kuznetsov Apr 21 '21 at 15:06
  • thank you ,but i need when the user send the value for example 0,1 or3 ... then he will get the content – hatta zouba Apr 21 '21 at 15:39
  • 1
    Does this answer your question? [Get selected option text with JavaScript](https://stackoverflow.com/questions/14976495/get-selected-option-text-with-javascript) – CyberEternal Apr 21 '21 at 19:25

0 Answers0