Why querySelector show 2 different way of result in Edge console?

60 Views Asked by At

I have a div element by id "test", and here is my javascript code:

const test = document.querySelector("#test");
console.log(test);

Then I open the console of Edge, but the result show 2 different way when I refresh the page, and I cannot figure the pattern out. Just like the GIF below: enter image description here

Along with click the refresh button, the console.log result is changed sometimes. but the code is never changed.

What should I do if I always want the result below?

enter image description here

0

There are 0 best solutions below