With all the sources and what I normally do to select an element by id, is to use .getElementById("eleID")
.
But have recently observed that I no longer need to use:
.getElementById("eleID").someMethod
or refence it with a variable:
x = document.getElementById("eleID");
x.someMethod`
But instead can go directly too:
eleID.someMethod
I've searched around but can only find advice on using .getElementById("eleID")
and when I first started could not just use eleID.someMethod
. I have now tested this in Chrome (and in an extension) and Firefox
I am wondering what has changed or has it changed? And why has this not been more widley discussed