0

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";
myTerminal
  • 1,596
  • 1
  • 14
  • 31
  • Try this solution, seems to be close enough. http://stackoverflow.com/questions/10767701/javascript-css-get-element-by-style-attribute – myTerminal Feb 26 '14 at 08:18

2 Answers2

0

Put that css into a css.class, and use getElementsByClassName(). Then just hide elements with that class when they occurs...

ThomasK
  • 2,210
  • 3
  • 26
  • 35
0
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);
SajithNair
  • 3,867
  • 1
  • 17
  • 23