Remove @id attributes instead of setting them to "" (the empty string).

Use jQuery.removeAttr() instead of jQuery.setAttr('id', '');