jQuery.findIncludeSelf
Trivial jQuery plugin, $(root).findIncludeSelf(selector)
is the same as find(selector)
but includes the subject node itself, if it matches the selector.
Specifically:
$foo.findIncludeSelf(selector)
is shorthand for
$foo.find(selector).addBack(selector)
Testing
$ bower install
$ npm install
$ npm test
Release Notes
- O.1.2 - Use https://api.jquery.com/jquery.fn.extend/. Thanks to JelteF
Credits
Taken from the stackoverflow answer provided by stackoverflow user Robert