I have some HTML code like this:
<div style="background:red;width:900px;height:200px" id="wrap">
<div id="inner" style="width:300px;float:left">
...
</div>
</div>
I need to:
1) Remove "styles" attribute and maybe some others
2) Leave only "id" attribute
4) Get resulting HTML as a string
5) All of this without affecting the original markup
I have tried cloning them as javascript object, but manipulations on them affect DOM.