The HTML Elements reference

"label" - html element

  • This element associates a label with a form control.
  • Starttag <label> is Required and endtag </label> is Required
  • Each element is associated with exactly one form control.
  • Browsers that support the label - element : Internet Explorer Mozilla Firefox Opera Google Chrome Apple Safari
Element "label" example:
<html>
  <body>
    <form action="tryexamples/getFerrari.php"
          title="get a Car">
      <fieldset>
        <legend>Buy a Car:</legend>
        <label for="car">Type: </label>
        <input id="car" type="text" name="car" value="Ferrari" /><br>
        <label for="model">Model: </label>
        <input id="model" type="text" name="model" value="2010"/><br>
        <label for="price">Price:</label>
        <input id="price" type="text" name="price" value="$100000"/><br>
        <label for="axcept">Price:</label>
        <input id="axcept" type="checkbox" name="axcept" value="1"/>
      </fieldset>
      <button type="submit" >Get the car</button>
      <button type="reset" >Reset form</button>
    </form>
  </body>
</html>


Attributes:
accesskey , class , dir , for , id , lang , style , title

Attribute "accesskey" value(s): a character as the accesskey
  • Assigns an access key to an element. Pressing an access key assigned to an element gives focus to the element. Will set focus in the label element.
  • The action that occurs when an element receives focus depends on the element.
  • The key combination that activates the link to which the accesskey is applied varies depending on the platform and browser combination.
These are for the windows platform:
Browser accesskey usage Remarks
Shift + Alt + accesskey Set the focus on the element and execute any link (a) if exist.
Alt + accesskey Set the focus on the element. Press enter to execute any link.
Shift + escape + accesskey Shift + escape gives you a list of possible accesskey related to the page.
Shift + Alt + accesskey Set the focus on the element and execute any link (a) if exist.
Shift + Alt + accesskey Set the focus on the element and execute any link (a) if exist.
Shift + Alt + accesskey Set the focus on the element and execute any link (a) if exist.
Shift + Alt + accesskey Set the focus on the element and execute any link (a) if exist.



© 2010 by Finnesand Data. All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the correctness in the pages or source codes.
The risk of using this web-site pages or any program codes from this website is entirely at the individual user.