HTML DOM Image height property
Definition and Usage
height property sets or returns the property value of the image height.
height attribute specifies the height of the image.
grammar
imageObject.height=pixels
Browser Support
All major browsers support height attribute
Examples
Examples
The following examples set the image height and width:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
function changeSize () {
document.getElementById ( "compman") height = "250".;
document.getElementById ( "compman") width = "300".;
}
</ Script>
</ Head>
<Body>
<Img id = "compman" src = "compman.gif" width = "107" height = "98">
<br> <br>
<Input type = "button" onclick = "changeSize ()" value = "modify image size">
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
function changeSize () {
document.getElementById ( "compman") height = "250".;
document.getElementById ( "compman") width = "300".;
}
</ Script>
</ Head>
<Body>
<Img id = "compman" src = "compman.gif" width = "107" height = "98">
<br> <br>
<Input type = "button" onclick = "changeSize ()" value = "modify image size">
</ Body>
</ Html>
try it"
Image Object