Search code examples
javascriptjqueryjquery-click-eventtypeerror

jQuery .is() - $(...).is(...).click does not return object, what does?


.is() does not return an object:

$("div").children().is(".result").click(function () { ... } );

I receive the error:

Uncaught TypeError: $(...).is(...).click is not a function

Is there a function that does the same thing as .is() but returns an object instead of a boolean?


Solution

  • .is just returns a boolean, so it can't be chained.

    Docs: http://api.jquery.com/is/