Label Element

Download html eBook

Syntax

  • <label>Example <input type="radio" name="r"></label> // Wrapping a control Element
  • <label for="rad1">Example</label> <input id="rad1" type="radio" name="r"> // Using for attribute

Parameters

AttributesDescription
forReference to the target ID Element. I.e: for="surname"
formHTML5, [Obsolete] Reference to the form containing the Target Element. Label elements are expected within a <form> Element. If the form="someFormId" is provided this allows you to place the Label anywhere in the document.

Related Examples

Stats

186 Contributors: 5
Friday, July 22, 2016
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook