I would like to select and element with a class called “validate_me”, but I don’t want to include any elements if they have text already inside them, but I’m stuck on the jquery. It looks like “:contains()” could do the trick but I don’t want to search for a particular string, I just want to “exclude” any element that already has text in it.
I hope this makes sense…How can I do this?
Thanks in advance.
Here’s what I attempted before, but it obviously doesn’t work:
$("input.validate_me:not(:contains('any text is allowed')),select").addClass("ui-state-error");
1 Answer