Skip to content

Instantly share code, notes, and snippets.

@juliocesar
Created March 23, 2009 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juliocesar/83845 to your computer and use it in GitHub Desktop.
Save juliocesar/83845 to your computer and use it in GitHub Desktop.
ANDing jQuery selectors
$.extend($.expr[':'], {
'and': function(a, i, m) {
return $(a).filter(m[3]).length
}
})
// Thus allowing $('p:and(.post)')
// finds <p class="post"></p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment