Looking for jQuery find(..) method that includes the current node

For jQuery 1.8 and up, you can use .addBack(). It takes a selector so you don’t need to filter the result:

object.find('selector').addBack('selector')

Prior to jQuery 1.8 you were stuck with .andSelf(), (now deprecated and removed) which then needed filtering:

object.find('selector').andSelf().filter('selector')

Leave a Comment