I am trying to do a simple thing such as:
var elements = document.getElementsByTagName(\"input\"); console.log(elements); console.log(elements.length);
This happens because of the asynchronous behaviour of JS. You're trying to display the element's value before it is being rendered. In order to avoid it, you could add the "async" attribute to your tag, as in the following example: