0

Possible Duplicate:
Is there a difference between new Image() and document.createElement('img')?

What is the difference between creating image object with Image function and createElement function? Is there any?

var image1 = new Image;
var image2 = document.createElement('img');
Community
  • 1
  • 1
Andrey M.
  • 3,688
  • 3
  • 33
  • 36
  • 2
    Possible duplicate of: [Is there a difference between `new Image()` and `document.createElement('img')`](http://stackoverflow.com/q/6241716/239241) – betamax Sep 13 '11 at 10:56

1 Answers1

1

The first construct an image object (javascript image object).

The second create build an img html element node.

user278064
  • 9,982
  • 1
  • 33
  • 46