How to add an object to the DOM tree? (not a div node), namely an object (within which the css of the corresponding div'a is already written).
I try appendChild , but nothing turns out ...
Here is the code:
var little = document.getElementById('littleField'); //ΡΠΎΠ·Π΄Π°ΡΠΌ Π΄ΠΈΠ² little.classList.add('little'); function Day(date, conteiner) { //ΠΊΠΎΠ½ΡΡΡΡΠΊΡΠΎΡ ΠΎΠ±ΡΠ΅ΠΊΡΠ° this.date = date; this.conteiner = conteiner; } Day.prototype.generateDate = function () { //ΠΏΡΠΎΡΠΎΡΠΈΠΏ ΠΎΠ±ΡΠ΅ΠΊΡΠ° var day1 = document.createElement('day1'); day1.classList.add('day'); conteiner.appendChild(day1); //ΠΏΠΎΠΏΡΡΠΊΠ° Π°ΠΏΠΏΠ΅Π½Π΄ΠΈΠ½Π³Π°))) } var array = []; //ΠΎΠ±Π΅ΠΊΡΡ Π² ΠΌΠ°ΡΡΠΈΠ² ΠΈ Π²ΡΡΠ°Π²ΠΊΠ° Π² Π΄ΠΈΠ². while (i <= 29) { var i = 0; var obj = new Day(i, little); //ΡΠΎΠ·Π΄Π°ΡΠΌ ΠΎΠ±ΡΠ΅ΠΊΡ array[i] = obj; i++; }