How to define a label for an input element using HTML? Last Updated : 19 Jun, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report To define a label for an input element in HTML5, use the <label> tag. This tag enhances usability by allowing users to click on the label text to toggle the associated input control. The <label> tag should include a for attribute that matches the id of the input element, ensuring a clear and accessible connection between the label and the input field. Syntax:<label> form content... </label>Example: The example below shows how to define a label for an input element using HTML5. html <!DOCTYPE html> <html> <head> <title> Define a label for an input element </title> <style> body { font-size: 20px; } </style> </head> <body style="text-align:center"> <h2> Label for an input element </h2> <form> <!-- Starts label tag from here --> <label for="student"> Student </label> <input type="radio" name="Occupation" id="student" value="student"><br> <label for="business"> Business </label> <input type="radio" name="Occupation" id="business" value="business"><br> <label for="other"> Other </label> <!-- Ends label tags here --> <input type="radio" name="Occupation" id="other" value="other"> </form> </body> </html> Output: Output Comment More infoAdvertise with us Next Article Blaze UI Input Labels and Form Elements M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML HTML5 HTML-Misc HTML-Questions +1 More Similar Reads How to define a form for user input using HTML5 ? In this article, we will learn how to create a form in a webpage by using the <form> tag. This tag is used to create form for user input. Also there are many elements which are used within form tag. Syntax: <form> Form Content... </form> Example: The following code snippet demonstr 1 min read How to define a caption for a fieldset element in HTML? The legend element defines a caption for the fieldset element in HTML. It specifies the title or description for the grouped contents within the fieldset. The fieldset element contains child elements, including the legend element, which serves as its title. Syntax:<legend> Content... </lege 2 min read Blaze UI Input Labels and Form Elements Blaze UI is an open-source CSS framework. It is a lightweight UI toolkit and provides great tools for building customized and scalable applications. It can work with any framework that exists. It can adapt to any ecosystem. All designs or CSS are mobile-first and hence responsive. It project is avai 2 min read How to specify a name for the fieldset using HTML ? The <fieldset> tag in HTML5 is used to make a group of related elements in the form and it creates the box over the elements. The <fieldset> tag is new in HTML5. The HTML <fieldset> name attribute is used to specify the name for the fieldset element. It is used to reference the for 1 min read How to Set a Minimum and Maximum Value for an input element in HTML5? To set minimum and maximum values for an input element in HTML5, we utilize the min and max attributes. For numerical inputs like type numbers, assign the desired limits directly. Alternatively, use JavaScript validation, pattern attributes, or event listeners for more complex validation scenarios, 3 min read How to specify the value of an input element using HTML ? In this article, we will set the value of an input element using HTML. The value attribute for <input> element in HTML is used to specify the initial value of the input element. It has different meaning for different input type: The âbuttonâ, âresetâ and âsubmitâ property specifies the text on 1 min read Like