Introduction:

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.

Description:

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.

 

<!DOCTYPE html>
<html>
<head>
    <title>This is the example of label tag</title>
</head>
<body>
    <p>Which language would you like to read ?</p>
    <form>
        <input type="radio" name="csharp" value="csharpdotnet" id="csharpdotnet">
        <label for="csharpdotnet">C# .Net</label>
        <input type="radio" name="vb" value="vbdotnet" id="vbdotnet">
        <label for="vbdotnet">VB.Net</label>
    </form>
</body>
</html> 

Output:

 how to use input tag in html


Note:-


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.

0 comments


Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.

You may also like