Javascript examples for CSS Style Property:maxHeight
Return the maximum height of a <div> element:
<!DOCTYPE html> <html> <head> <style> #myDIV {/*from www.j a v a 2s.c o m*/ width: 500px; background-color: lightblue; overflow: auto; } </style> </head> <body> <button onclick="myFunction()">Test</button> <div id="myDIV" style="max-height:100px;"> <p>test</p> <p>test</p> <p>test</p> </div> <script> function myFunction() { console.log(document.getElementById("myDIV").style.maxHeight); } </script> </body> </html>