HTML <etichetta> per Attributo
Esempio
Tre pulsanti di opzione con etichette:
<form action="/action_page.php">
<input type="radio" id="html" name="fav_language" value="HTML">
<label for="html">HTML</label><br>
<input type="radio" id="css"
name="fav_language" value="CSS">
<label for="css">CSS</label><br>
<input type="radio" id="javascript" name="fav_language" value="JavaScript">
<label for="javascript">JavaScript</label><br><br>
<input
type="submit" value="Submit">
</form>
Definizione e utilizzo
L' for
attributo specifica a quale elemento del modulo è associata un'etichetta.
Supporto del browser
Attribute | |||||
---|---|---|---|---|---|
for | Yes | Yes | Yes | Yes | Yes |
Sintassi
<label for="element_id">
Valori di attributo
Value | Description |
---|---|
element_id | The id of the element the label is bound to |
❮ Tag HTML <etichetta>