I have a very long source code, so I provided the method I am working at the moment below. When I type console.log(div)
it doesn't render the tree elements. What it renders is in the picture. Why is it doing this?
Method I am working on:
playPauseIcons(){
let tdd = this.table.addRowImage();
console.log(tdd);
let img = this.table.getImg();
console.log(img)
console.log(this.table)
let icondsDiv = document.createElement('div');
let playDiv = document.createElement('button');
let pauseDiv = document.createElement('button');
icondsDiv.classList.add('icons_div');
playDiv.classList.add('play');
pauseDiv.classList.add('pause');
function animation(){
// console.log('pls')
img.style.animation = 'car_move 2s ease-in'
}
function stopAnimation(){
img.style.animation = 'none'
}
playDiv.addEventListener('click', () => {animation()});
pauseDiv.addEventListener('click', () => {stopAnimation()})
tdd.appendChild(icondsDiv);
icondsDiv.appendChild(playDiv);
icondsDiv.appendChild(pauseDiv);
console.log(icondsDiv)
let tr = this.table.beginRow()
tr.appendChild(tdd);
console.log(tr)
console.log(tdd)
console.log('tr from CVC' + tr);
let tbody = this.table.endRow();
console.log(tbody)
console.log(tr)
tbody.appendChild(tr);
console.log(tbody)
tr = null;
}