We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

Image

Image Element constructor

Accepts two optional parameters: Image([unsigned long width, unsigned long height])

Example:

var myImage = new Image(100, 200);
myImage.src = 'picture.jpg';
console.log(myImage);
Result:
<img width="100" height="200" src="picture.jpg">

 

Note: this constructor exists for historical reasons only and returns an HTMLImageElement instance just as document.createElement('img') would.

 

Document Tags and Contributors

Last updated by: teoli,