Hi,
I have a page that contains 20 select's with a class name of '.ct'. I need a selector that determines if a select exists that contains 3 or more options.
Thanks, Chris
Hi,
I have a page that contains 20 select's with a class name of '.ct'. I need a selector that determines if a select exists that contains 3 or more options.
Thanks, Chris
You can use the nth-child selector to check for a 3rd <option>
, like this:
if ($('select.ct option:nth-child(3)').length)
; // Do stuff