I want to display the image in from a <button> but there seems to be some kind of problem.
I can't display the image. I've read some articles concerning about Javascript and OOP, I just don't know if I used them correctly as it is said.
Now going to my code, here what it looks like:
function myFunction() {
function Image(src, height, width) {
this.src = src;
this.height = height;
this.width = width;
}
image.prototype.display = function () {
document.body.appendChild(image);
}
var image = new Image("image.jpg", "200", "200");
image.display();
}
}
Hope you help me out :)
Imagealready exists as a constructor.