HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> div{ height: 200px; width: 300px; margin:10px 0px; border:1px solid #737373; } </style> </head> <body> <p>Click on the button to display the client height of the following div</p> <button onclick="myFunction()">Click Me</button> <div id="point"> </div> <script> var x = document.getElementById("point"); var elem = document.getElementsByTagName("div")[0]; function myFunction(){ x.innerHTML = "Client Height: " +elem.clientHeight; } </script> </body> </html>
OUTPUT
×

Save as Private