mozilla
Your Search Results

    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

    Contributors to this page: teoli
    Last updated by: teoli,