Input element

Can someone let me know why the console logs different values as I refresh the page? Sometimes I get

<input id="test" type="button" /> and sometimes I get input#test

let myButton = document.getElementById("test");

myButton.addEventListener("click", function (e) {


This one’s actually the object map view. If you drop down the arrow next to it, you’ll see all the properties of the element.

It seems to be random; if you absolutely need it to be one way or the other, use console.dirxml (for the HTML type) or console.dir (for the object type).

i don’t need it. I was curious why it changes at random as I refresh the page