How to identity and select text Drop down in webpage


#1

how to select an item from text drop down ? , I have a drop down which will show results when passing some text to it and i need to select one of the item from the list.


#2

Hey ! I recommend this answer :slight_smile:


#3

Hi,
Logic below
Get attributes of all the options of a dropdown, Only one option of all option will have a html attribute “selected” , take the text of the option (which mean this is selected in the dropdown).

Please let me know if it works for you.

Example:


<select>
  <option value="volvo">Volvo</option>
  <option value="saab" selected >Saab</option>
  <option value="opel">Opel</option>
  <option value="audi">Audi</option>
</select>
  
</body>
</html>

Thanks