remove all css from a webpage

5:27 am, April 16, 2018
this removes the head element from the site, which usually contains most of the css and sometimes javascript is added there as well. // lets remove the head element. document.head.parentNode.removeChild(document.head); // then set some custom styles // document.getElementsByTagName("body")[0].style = "background" // set a single element to white //document.body.style.background = "#EFEFEF"; elements = document.getElementsByClassName(x); for (var i = 0; i < elements.length; i++) { elements[i].style.backgroundColor="#EFEFEF"; } var all = document.getElementsByTagName("*"); for (var i=0, max=all.length; i < max; i++) { // Do something with the element here all.style.backgroundColor="#EFEFEF"; }

Code

html
css
js
scripts

Download & Run

Download File Run Demo Re-load Preview

Preview

twBIi