Adrian Lynch wrote:
When I do something like the following $("div/a"), is there a way to
determine if that doesn't match any elements?

find(expr) looked like the one but it returns a jQuery object. Can I
interrogate this to see if it is "empty"?

Thanks.

Adrian

Adrian, to check if that set is empty, try:

var isEmpty = !$("div/a").length

But jQuery has that goodness build in and most of the time you don't need that check, because

$("div/a").hide();

won't do anything, if the selector "div/a" does not match any elements, e.g. the jQuery object is empty.


--Klaus

Reply via email to