Check out this HTML snippet:
<html>
<head>
<link rel="stylesheet" type="text/css" media="all" href="style.css">
</head>
<body>
<div id="test">Testing</div>
<script>
alert(document.getElementById('test').style.display);
</script>
</body>
</html>
This is the content of style.css:
div {
display:none;
}
The issue I'm facing is that instead of getting "none", the JavaScript code returns an empty string. Any suggestions on how to fix this problem would be greatly appreciated!