Introduction:

In this article we are going to explain what is <label> tag in html or why use label tag in HTML or how to use label element in html with example.

Description:

The <label> tag is used to display a label for an <input> element. It adds a label to a form control such as text, email, password, textarea etc.

 

Let's see an example of <label> tag in HTML.

 <!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 a label tag in html


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