I have a dom and in this i have loaded whole of the webpage html. I want to remove all the inline style from all the elements in this page. How can i do this.
var all = document.getElementsByTagName("*");
for (var i=0, max=all.length; i < max; i++) {
// Do something with the element here
all[i].removeAttribute("style","")
}
Using DOM is the simpliest way.
Here's what I would do.
styles attribute using DOMXPath.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With