Get computed Height of an HTML Element





15
Date Submitted Fri. Aug. 18th, 2006 6:48 AM
Revision 1 of 1
Syntax Master sundaramkumar
Tags CSS | JavaScript
Comments 3 comments
Get computed Height of an HTML Element


function getComputedHeight(theElt){
        if(is_ie){
                tmphght = document.getElementById(theElt).offsetHeight;
        }
        else{
                docObj = document.getElementById(theElt);
                var tmphght1 = document.defaultView.getComputedStyle(docObj, "").getPropertyValue("height");
                tmphght = tmphght1.split('px');
                tmphght = tmphght[0];
        }
        return tmphght;
}

 

Comments

Comments The missing bit:
Mon. Oct. 22nd, 2007 9:04 AM    Beginner richard123
Comments incomplete
Tue. Aug. 29th, 2006 11:02 AM    Newbie Guerrero
Comments thank you.good luck
Wed. Apr. 4th, 2007 12:36 AM    Newbie sim_louay

Voting