HTML5 Attribute Tutorial and HTML5 Attribute Reference

Published on: September 9, 2014   Last Updated on : June 6, 2018   Posted By : WebDesignReference

What’s an attribute in HTML5 ?

An attribute is an additional behavior or property of an element. It is specified within an element like title attribute, language attribute, Href attribute etc.

Example : <a href=”” title=”home-link”>This is a home page link</a>

Here “Href” and “title” are additional behaviour of an element.

There are some common Attribute in HTML5 :

  • Class : It is used for defining class of an element.
  • Id : It specifies id or name of an element.
  • Style: this behaviour is used for styling of an element.
  • Title : It is used for title or tooltip of an element.
  • Alt: It is used for alternate text of an image.
  • Src: This is used for source path of an image.
  • value : It specifies the value of an element.
  • Href : It specifies the link url.

There are some new Attribute for form in HTML5 :

  • autocomplete : Example of Autocomplete attribute in html5:
    <form action=”submit-page.html” autocomplete=”on”> First name:<input type=”text” name=”first-name”><br> Last name: <input type=”text” name=”last-name”><br> E-mail: <input type=”email” name=”email” autocomplete=”on”><br> <input type=”submit” class=”submit-button”> </form>
  • novalidate : Example of Novalidate attribute in html5:
    <form action=”submit-page.html” novalidate> E-mail: <input type=”email” name=”email” autocomplete=”on”><br> <input type=”submit” class=”submit-button”> </form>

There are some new commonly used Attribute for Input type in HTML5 :

  • Autocomplete
  • Autofocus
  • Height
  • Width
  • placeholder
  • required

Also Related to HTML5