I am trying to get the value of "display" through JS sorted by Classes. My code is:
var x = document.getElementsByClassName("codeContainer");
alert(x[0].style.display);
The thing is that the alert box is just empty. The call
alert(x.length);
works great and returns "4". What am I doing wrong? Thanks very much!
The property "style.display" is not defined. therefore it returns "empty"
You can try this: