Is there a simple way to use jQuery to remove all background styles on a page? Specifically, need to remove background color and images.
Real simple with jQuery...
$('*').css('background', 'transparent');
jsFiddle.
If you didn't have jQuery at your disposal...
var allElements = document.getElementsByTagName("*");
for (var i = 0, length = allElements.length; i < length; i++) {
allElements[i].style.background = "none";
}
jsFiddle.
$('*').css('background', 'transparent');
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