querySelector() returns undefined string when trying to access numeric value as the ID of an element. I would like to use querySelector() method over others, because it is more flexible.
Any solutions to this problem would be a great help.
var foo = document.querySelector('#1');
console.log(foo);