I just started with JS and I created a Contructor for a box. Now I want a box that can store Images and a box that can store text. How do I declare the new box objects, with prototype?
//box constructor
function Box(x, y, w, h) {
this.x = x;
this.y = y;
this.w= w;
this.h= h;
}
//image box features:
this.src = ....
this.title = ...
//text box features:
this.font = ...
this.font-size=...
this.color=....