"Orson" <bilge43@yahoo.com> writes:
[color=blue]
> I have a CSS div defined as follows :
> <div id="col-2" >
>
> In some circumstances I want to change its width.
> I have tried all the following within a javascript function:[/color]
Blindly trying isn't the best approach :)
[color=blue]
> document.getElementById("col-2").width= "900";
> document.getElementById("col-2").resizeTo(900, 520);
> document.getElementById("col-2").width.value= "900";
> document.all.col-2.resizeTo(900, 520);
> document.layers["col-2"].resizeTo(900, 520);[/color]
You should test whether
document.getElementById("col-2")
works at all. Try starting out with:
alert( document.getElementById("col-2") );
If that works, go on to changing the position.
[color=blue]
> None of which have worked.[/color]
....[color=blue]
> Can someone point out the right way to do it?[/color]
Try:
document.getElementById("col-2").style.width = "900px";
That would use CSS to set the width.
/L
--
Lasse Reichstein Nielsen -
Join Bytes!
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'