Reputation: 13614
In all other browsers, element.style seems to work fine. But Internet Explorer 8 doesn't know it...
Getting this error when x is a div:
Error: 'x.style.left' is null or not an object
x.style itself is undefined. I looked at http://www.quirksmode.org/dom/changess.html but it doesn't say anything about styles on specific elements, just like http://help.dottoro.com/ljuefnvw.php doesn't say anything either.
Upvotes: 0
Views: 489
Reputation: 29975
<div id="example">
Test
</div>
<script>
document.getElementById('example').style.marginLeft = '50px';
</script>
works
Upvotes: 3