1

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?

Example Picture Here

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;

     }
   
server_unknown
  • 407
  • 2
  • 17
Alexa
  • 21
  • 4
  • There is no `console.log(div)` in the code you have included. – DBS Jan 26 '23 at 12:06
  • 1
    `console.log('tr from CVC' + tr);` makes no sense, because it implicitly calls `tr.toString`, which is not a useful representation of `HTMLElement`s. Try `console.log('tr from CVC', tr);` instead. In the console output, there are no attributes shown that aren’t shown within tags. – Sebastian Simon Jan 26 '23 at 12:06
  • Why would you expect `console.log(div)` to do something? There's nothing in the code in your question that relates to the problem. – Andy Jan 26 '23 at 12:08
  • Sorry, I am new to posting here. I mean when I put some html element so for example console.log(tr) I would expect something like this as I belive had before. But now I get >tr >attributes – Alexa Jan 26 '23 at 12:11
  • @WandaWix Be precise, please. Are you referring to `…`? What is the problem with that? – Sebastian Simon Jan 26 '23 at 12:17
  • @SebastianSimon I mean ```td colspan="4"...tr ``` and not like this ``` ``` – Alexa Jan 26 '23 at 12:23
  • 1
    Please [edit] your question and provide a [mre] and specify your exact browser. This is not reproducible so far. – Sebastian Simon Jan 26 '23 at 12:37
  • The earlier messages were printed when devtools was closed, apparently, hence the difference. – wOxxOm Jan 26 '23 at 13:30

0 Answers0