Skip to content

Instantly share code, notes, and snippets.

@jcromartie
Created May 31, 2012 20:11
Show Gist options
  • Select an option

  • Save jcromartie/2845902 to your computer and use it in GitHub Desktop.

Select an option

Save jcromartie/2845902 to your computer and use it in GitHub Desktop.
$.fn.findNS
(function($) {
// an extension to jQuery to allow "find" with XML namespaces
$.fn.findNS = function(ns, selector) {
var prefix = ns + ":";
return this.find(selector).filter(function(idx, el) {
return el.nodeName.indexOf(prefix) == 0;
});
}
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment