Return the minimum height of a <div> element: - Javascript CSS Style Property

Javascript examples for CSS Style Property:minHeight

Description

Return the minimum height of a <div> element:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<div style="background:red;min-height:150px;" id="myDiv">This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.</div><br>

<button type="button" onclick="myFunction()">Return min height of div</button>

<script>
function myFunction() {/*from   w w  w  .ja v a 2s  .  com*/
    console.log(document.getElementById("myDiv").style.minHeight);
}
</script>

</body>
</html>

Related Tutorials