Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to get the height of div with js? When the height exceeds 630px, a scroll bar appears; When the height is less than 630px, the scroll bar is hidden.
How to get the height of div with js? When the height exceeds 630px, a scroll bar appears; When the height is less than 630px, the scroll bar is hidden.
& ltdiv id = " myDiv " & gt& lt/div & gt;

& ltscript type = " text/JavaScript " & gt;

document.getElementById("myDiv ")。 clientHeight & gt600 ? { document . getelementbyid(" my div "). style . overflow = " scroll "; }:{ document . getelementbyid(" my div ")style . overflow = " none "; };

& lt/script & gt;