HTML Attributes

HTML label attribute

Build a form with the HTML form generator

Supplies a human-readable label for optgroup, option or track. It is not the same as the label element used to name form controls. Applicable elements include: <optgroup>, <option>, <track>. Check each element’s value rules.

Formal Syntax & Structure

html syntaxhtml
label="Tea"

Parameters & Attributes

NameTypeDescription
labeltextSupplies a human-readable label for optgroup, option or track. It is not the same as the label element used to name form controls.

Working Example

Example Snippethtml
<select aria-label="Drink">  <optgroup label="Tea">    <option>Green</option>  </optgroup></select>
HTML Reference