playing around with some HTML element I came across a image object declaration
var image = new Image();
Could somebody tell me where this constructor is defined? I have searched ECMAScript and some hmtl specifications...
Regards
playing around with some HTML element I came across a image object declaration
var image = new Image();
Could somebody tell me where this constructor is defined? I have searched ECMAScript and some hmtl specifications...
Regards
While being well supported across browsers, isn't part of any standard the closest Image()
comes to being part of a standard is an appearance in the HTML 5 draft. There is some documentation for Image
on MDN.
I'd generally recommend using createElement
instead as it provides a consistant API for creating any kind of element and is part of the DOM standards.
It is part of the HTML DOM (not part of ECMAScript), see this link: