Skip to content

Instantly share code, notes, and snippets.

@iamntz
Forked from anonymous/StefanZWrapBox
Created August 29, 2011 09:24
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 iamntz/1178075 to your computer and use it in GitHub Desktop.
Save iamntz/1178075 to your computer and use it in GitHub Desktop.
Wrap box for my current project
$('.borderedBox, #content').each(function() {
var t = $(this),
mainClasses = this.className,
mainIds = this.id,
idAttr = ( mainIds ? ' id="' + mainIds + '"' : '' ),
classAttr = ( mainClasses ? ' class="' + mainClasses + '"' : '' );
t.wrap('<div ' + idAttr + classAttr + ' / >');
t.removeAttr('class').removeAttr('id');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment