Open roryashfordbentley opened 9 years ago
This may be a better option:
function removeStyles(el) {
el.removeAttribute('style');
if(el.childNodes.length > 0) {
for(var child in el.childNodes) {
/* filter element nodes only */
if(el.childNodes[child].nodeType == 1)
removeStyles(el.childNodes[child]);
}
}
}
Nicked from here: http://stackoverflow.com/questions/9252839/simplest-way-to-remove-all-the-styles-in-a-page
Just to throw yet another spanner in the works style can be set using a <style>
element as well as an attribute.
Playing around with this some more I have noticed that SVG's can store style attributes in a multitude of places other that 'paths'. As an example:
There are also shape elements (
<circle>
,<ellipse>
,<line>
,<polygon>
,<polyline>
,<rect>
) which can contain style tags. There may be others too from this list: https://developer.mozilla.org/en-US/docs/Web/SVG/ElementThe above svg code was generated by Adobe3 Photoshop CC 2014 using the Extract Assets function.