HTML | DOM image naturalWidth property
naturalWidth : property is used to get the original width of an image. Since the width of an image to be displayed on the webpage can be modified using the ‘width’ attribute of the <img> tag, hence the naturalWidth property becomes useful in situations where the original width of the image is required rather than the customized one. It is a read-only property.
Return Value: It returns the original width of the image in pixels.
- Google Chrome
- Internet Explorer 9.0 or above
- Mozilla Firefox
Attention reader! Don’t stop learning now. Get hold of all the important Comcompetitivepetitve Programming concepts with the Web Design for Beginners | HTML course.