How to select Crayons elements based on the 'state' attribute

I have been trying to use the attribute CSS selector to get all the Crayons elements in a div that have the error state but I can’t get it to work. Example of what tried below: Any ideas?

$("#mydiv, [state=‘error’]")

Ok. I cracked this myself and it was me being a bit dumb :man_facepalming:

I was setting the state as a property and not an attribute hence the selector wouldn’t work…doh!

1 Like

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.