max

UK[m?ks] 美[m?ks]

adv.At most

height

英[ha?t] 美[ha?t]

n.Height; height, altitude; highland; top, vertex

Plural: heights

javascript maxHeight property syntax

Function:Set the maximum height of the element.

Syntax: Object.style.maxHeight=length|%

javascript maxHeight property example

<html>
<head>
	<meta charset="UTF-8">
<script type="text/javascript">
function setMaxHeight()
{
document.getElementById("p1").style.maxHeight="10px";
}
</script>
</head>
<body>

<p id="p1">這是一些文本內(nèi)容,這是一些文本內(nèi)容,這是一些文本內(nèi)容,這是一些文本內(nèi)容</p>

<input type="button" onclick="setMaxHeight()"
value="Set max height" />

</body>
</html>

Run instance ?

Click the "Run instance" button to view the online instance