Last Updated : Jan 1, 2023
Then this is possible only if we apply validation and get the values of input fields to check whether they are valid or not.
Here, to get the value of the input field, three main ways are most commonly used. That is:
- By using getelementbyid
- By using getelementbyclassname
- By using queryselector
In this tutorial, we are going to understand only the first one which is getelementbyid whereas the rest will be discussed in our next sessions because understanding all concept in one tutorial make the tutorial lengthy to read.
So, using the codes below we will understand first how to use getelementbyid and then understand this with help of steps later.
- First, we here create a basic structure of HTML. For this, we use HTML, head, title, and body with a script tag. We hope you know about the basic structure of HTML and which HTML tag is used for which concept.