Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
/*!
* jQuery nodetype filter - v0.1pre - 11/18/2010
* http://benalman.com/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*
* Variation by Anton M.
*/
(function($){
var types = {
element: 1,
text: 3,
comment: 8
};
$.fn.nodetype = function( type ) {
var type = typeof type === "string" ? types[ type.toLowerCase() ] : type;
return jQuery( jQuery.grep( this, function( ele, i ) {
return ele.nodeType === type;
}));
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.