I have the following javascript code

```
var myDiv = document.getElementById("myDiv");
alert(myDiv);                
myDiv.style.display = 'none';

```

the call to **alert(myDiv)** succesfully shows that myDiv is not null and I see that the object (the div) has all the necessary properties set etc.

However, the call to **myDiv.style.display = none** results in an **Object Required** javascript error in IE 8.

Any pointers on what I need to check?

Thanks.