var year= document.getElementById(“year”); var brand= document.getElementById(“brand”); var model= document.getElementById(“model”); var btn= document.getElementById(“btn”);
btn.addEventListener(“click”,function(){
class Car { constructor(year,brand,model) { this.year = year; this.brand = brand; this.model = model;
}
present(x) { return x + “, I have a ” + this.year+ ” ” + this.brand+ ” ” + this.model; } }
mycar = new Car(year.value, brand.value,model.value);