You can use selectors like :contains fo find out if the currently selected option in a select contains a specific text, e.g.

var $el = $('#myselect option:contains("yes"):selected').length > 0 ? true : false;

I try to figure out more about these selectors, but I don't know how they are called to google them. Where can I inform myself?

1 Answers

2
Tobiq On Best Solutions

They're called Pseudo-classes.

https://www.w3schools.com/jquery/jquery_ref_selectors.asp


Some used by jquery may not actually be available standard CSS.

For example contains isn't a thing - but has is