3.2.0

style in div tag

I have a phrase code:

<script language=javascript>
function setStyle(){
var i=300;
test.style.overflow="scroll";
test.style.background='red';
test.style.height=i;
}
</script>
<body onload=setStyle()>
<div id="test" >
aaa
bbb
</div>
</body>

But it is not working. Can you help me to make it run? Thank you very much.
April 29,
Okay... I'm not the ActiveWidgets forum police, but I think everyone here would prefer to keep this forum specific to ActiveWidgets questions... which your post has nothing to do with.

However, what's not working about it... and what browser are you using to test it with?

It works fine on IE 6.
brians
April 29,
Put this in the function instead.

var i = 300;
elem = document.getElementById('test').style;
elem.overflow = 'scroll';
elem.background = 'red';
elem.height = i + 'px';
mjac
June 2,

This topic is archived.

See also:


Back to support forum