How can I showcase film1, film2, and film3 in my HTML code? I attempted:
peliHtml.innerHTML = `${this.Film.title};
However, I keep encountering a console error. How should I go about displaying this data in the html?
HTML
<p id="films"></p>
JAVSCRIPT
class Film {
title = '';
director = '';
genre = '';
date = '';
getDates(){
return `marca: ${this.title} - director: ${this.director}, genre: ${this.genre}, date: ${this.date}`;
};
constructor(title, director, genre, fechaEstreno){
this.title = title;
this.director = director;
this.genre = genre;
this.date = date;
}
}
let film1 = new Film('El hobbit', 'peter jackson', 'aventura', '23-02-2002');
let film2 = new Film('El hobbit 2', 'peter jackson', 'aventura', '23-02-2010');
let film3 = new Film('El hobbit 3', 'peter jackson', 'aventura', '23-02-2020');
const peliHtml = document.getElementById('films');
peliHtml.innerHTML = `${this.Film.title}`;