Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get rid of Sizzle's IE custom attributes
In IE, Sizzle has to create custom attributes to be able to travel the DOM intelligently. The custom attributes are lengthy and nasty, and can often screw up your code if you rely on parsing markup. fizzleSizzle wipes all that stuff out.
// Pass in a string of markup and get it back without Sizzle's shizzle
var fizzleShizzle = function(x){
return x.replace(/(nodeIndex|sizcache|sizset)[\w\d]*(="[^"]*")*/gi,'');
if(!$) return;
// Strip the shizzle from the DOM; pass a truthy argument to do the same for all children
$.fn.fizzleShizzle = function(deep){
var $el = deep ? this.add(this.find('*')) || this;
// Iterate through the selection
el = this,
ats = el.attributes;
// Iterate through attributes
// Is it one of these?
// Fizzle it
return this;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.