In this article we are going to explain what is <input> tag in html or why use input tag in HTML or how to use input element in html with example.
The <input> tag use to represent an input field where the user can enter data. <input> elements are used within a <form> element to declare input controls that allow users to input data. This form input control facilitate user to input data and communicate with a website or application.
Let's take an example of an HTML form with three input fields, two text fields and one button for submission.
<title>This is the example of label tag</title>
<p>Which language would you like to read ?</p>
<input type="radio" name="csharp" value="csharpdotnet" id="csharpdotnet">
<label for="csharpdotnet">C# .Net</label>
<input type="radio" name="vb" value="vbdotnet" id="vbdotnet">
1. Use the input element within the form element to declare input control that allow user to enter data.
2. The input element is empty. It contains attributes only. There is no need of an end tag in HTML.
3. If you want to define labels for input element, use the label element with each input tag.
I hope this article will help to you after reading.