I found myself having issues with this same problem today and have found out a few interesting things.
In IE (they just have to be different don't they) the style attribute is actually treated as an Element. You can set the different style properties by using the syntax shown below.
Comment
I found myself having issues with this same problem today and have found out a few interesting things.
In IE (they just have to be different don't they) the style attribute is actually treated as an Element. You can set the different style properties by using the syntax shown below.
oNewDiv = createElement('div');
oNewDiv.style.setAttribute('border', '1px solid #000');
oNewDiv.style.setAttribute('backgroundColor', '#fff');
Of course, this fails terribly in firefox :(
However, I have always been able to set styles without the setAttribute function in a cross browser supported way like:
oNewDiv.style.backgroundColor = '#fff';