Image naturalHeight Property
Return the original height of an image:
The result of x will be:
Definition and Usage
The naturalHeight property returns the original height of an image.
For example, if you have an image that is originally 200 pixels high. Then, you style the image with CSS/or by using the HTML "height" attribute to make it 500 pixels high. The naturalHeight property will return "200", the height property however, will return 500.
Note: This property is read-only.
|Return Value:||A Number, representing the original height of an image in pixels|
The difference between the naturalHeight property and the height property:
var y = document.getElementById("myImg").height;
❮ Image Object