I'm trying to write a script to hide all elements with a certain style.
I want to do something like this:
var hide = document.getElementByStyle("border: 3px ridge #333333").style.display="none";
I'm trying to write a script to hide all elements with a certain style.
I want to do something like this:
var hide = document.getElementByStyle("border: 3px ridge #333333").style.display="none";
Put that css into a css.class, and use getElementsByClassName()
. Then just hide elements with that class when they occurs...
function editStyles(el) {
if(el.getAttribute('style') == 'border: 3px ridge #333333')el.style.display='none';
if(el.childNodes.length > 0) {
for(var child in el.childNodes) {
if(el.childNodes[child].nodeType == 1)
editStyles(el.childNodes[child]);
}
}
}
editStyles(document.body);