Jump to content

problem with error in javascript


Ninjakreborn

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.
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?

Archived

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

×
×
  • Create New...

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.