Tyler Gillies
Tyler Gillies

Reputation: 1907

why can't I assign properties to a new Image object?

foo = new Image()
foo.x = 500
foo.x => 0

Upvotes: 0

Views: 273

Answers (1)

sharpner
sharpner

Reputation: 3937

var image = new Image();
image.foo = 100;
alert(image.foo); 

works perfectly, you can't change x because it's predefined and has only a getter Method

Upvotes: 4

Related Questions