Forum Moderators: open
I'm looking for a W3C-compliant way of checking the height of a div and resizing it if it is shorter than another div.
function checkHeight() {
var c1 = document.getElementById("c1");
var c2 = document.getElementById("c2");
if(c1.offsetHeight < c2.offsetHeight){
c1.style.height = c2.offsetHeight;
}
}
Something along these lines. I've tried using offsetHeight, clientHeight, style.pixelHeight, all these kind of things.
What I'd really like to know is what is a standards-compliant way of doing this. Failing that, just something that works (nothing has yet). Thanks.