HTML DOM height Property
Complete Style Object Reference
Definition and Usage
The height property sets the height of an element.
Syntax
Object.style.height=auto|length|%
|
Possible Values
Value |
Description |
auto |
The browser calculates the actual height |
length |
Defines the height in px, cm, etc. |
% |
Defines the height in % of the containing block |
Example
The following example sets the height of a button:
<html>
<head>
<script type="text/javascript">
function setHeight()
{
document.getElementById("b1").style.height="50px";
}
</script>
</head>
<body>
<input type="button" id="b1" onclick="setHeight()"
value="Change height of button to 50 px" />
</body>
</html>
|
Try-It-Yourself Demos
height - Set the height of an element
Complete Style Object Reference
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|