Easy Tutorial
❮ Event Onfocusout Prop Text Name ❯

Image height Attribute


Definition and Usage

The height attribute sets or returns the value of the height attribute of an image.

The height attribute specifies the height of the image.

Syntax


Browser Support

All major browsers support the height attribute.


Example

The following example sets the height and width of an image:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>tutorialpro.org(tutorialpro.org)</title>
<script>
function changeSize(){
    document.getElementById("compman").height="250";
    document.getElementById("compman").width="300";
}
</script>
</head>
<body>

<img decoding="async" loading="lazy" id="compman" src="compman.gif" width="107" height="98">
<br><br>
<input type="button" onclick="changeSize()" value="Modify Image Size">

</body>
</html>

❮ Event Onfocusout Prop Text Name ❯