Jump to content

Archived

This topic is now archived and is closed to further replies.

Ninjakreborn

problem with error in javascript

Recommended Posts

[code]
function autodivheight (div1, div2) {
var divheight = document.div.getElementById('div1').style.height;
document.div.getElementById('div2').style.height = divheight;
//var divtochange = document.getElementById('div1').style.height;
//document.getElementById('div2').style.height = div1;
}
</script>
</head>
<body onload="autodivheight (leftnav, rightcontent);">[/code]
It's telling me expected object or something, unexpected object.
Am I referencing my div's wrong, those are the id names for the div's
I also tried with the .div.

Share this post


Link to post
Share on other sites
I found out what I needed, I just have a question.

How can I record the height of an element (for instance: div) using javascript.,  I need to trap the height of a div into a variable to use with some calculations, how do I do this?

Share this post


Link to post
Share on other sites
clientHeight and/or offsetHeight are useful, but I don't remember what FF does with these.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.