Short Version: Is it standard behaviour that myDiv.style.display
(Javascript) returns blank when I have set that div
to display:none<
It's not working because you removed it as a style
attribute on your element, and placed it in an external stylesheet. DOM will not show attribute values that do not exist in the document object (DOM is merely an XML parser that reads your HTML document verbatim).
To find CSS values set in an external stylesheet, you have to parse document.styleSheets
and find the matching selector(s).
This is where using a library like jQuery
becomes really handy, because it parses external stylesheets, and has helper methods to get the full CSS applied to an element.
Example of how you would do this in jQuery:
value = $("#anID").css("display");
PS - Looking for an empty string won't work for you, either, because display: "" is not the same as display: "none" (and in fact, is the same as display: block, for a div, because a blank essentially means inherit
)