We can spy on an element and find all the available methods in DOM for accessing the html attributes for that element. In the Console tab, if we type document. all the methods like getElementById, getElementsClassName and so on will be visible as suggestions. The below image shows some of the methods in DOM.
As the Name edit box is the first matching element on the page we shall refer to that index number with . On hovering over the result returned by the expression document.getElementsByName("name") in Console, our desired element gets highlighted.