You can get the element by using id, for that you have to use a getElementById method in JavaScript. But you have to define id for the specified element (field).
Note: Returns null if no elements with the specified ID exists.
Example of JavaScript get element by id
HTML example code How to Get the element with the specified ID in JavaScript:
This method used almost every time you want to manipulate, or get info from, an element on your document. In the example we are using it only get element.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<!DOCTYPE html> <html> <body> <p id="demo">Hello </p> <script> var txt = document.getElementById("demo"); alert(txt); </script> </body> </html> |
Output:

Do comment if you have any doubts and suggestion on this topic.
Note: All JS Examples codes are tested on the Firefox browser and the Chrome browser.
OS: Windows 10
Code: HTML 5 Version