I\'m trying to check in jQuery if a div contains some text, and then add a class if it does.
So I wrote something like this:
if( $(\"#field >
Ayman is right but, you can use it like that as well :
if( $("#field > div.field-item").text().indexOf('someText') >= 0) { $("#somediv").addClass("thisClass"); }