Reputation: 6232
I know this works:
var $object = $('*:contains("I am a simple string")');
So why doesn't this work as well?
var $object = $someObject:contains("I am a simple string");
Upvotes: 0
Views: 192
Reputation: 359776
That's syntactically invalid JavaScript. Even if you change the :
to a .
in the second case, there is no .contains()
method, so I think this is what you intend:
var $object = $someObject.find('*:contains("I am a simple string")');
Upvotes: 1