$('#myImage').removeAttr('class').removeAttr('style').removeAttr('border');
That one works just fine but is there a way to remove a set of attributes from an element?
I altered the code a bit, like
$.fn.removeAttrs = function () {
// Convert all passed arguments to an array
var args = arguments[0].split(' '),
attr;
// Loop, removing the first array item on each iteration
while (attr = args.shift())
this.removeAttr(attr);
// Return the jQuery object for chaining
return this;
}
call it like below
$('#myImage').removeAttrs('class style border');