Skip to content

Instantly share code, notes, and snippets.

@AbraaoAlves
Created December 28, 2011 20:10
Show Gist options
  • Save AbraaoAlves/1529492 to your computer and use it in GitHub Desktop.
Save AbraaoAlves/1529492 to your computer and use it in GitHub Desktop.
jQuery parentN
$.fn.parentN = function(n){
var result = this;
for(var i = 0; i< n; i++)
result = result.parent();
return result;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment