HTML5 Form Input Types and Attributes

  • HTML5 has introduced 13 new input types and several new attributes for <form> and <input> tags.
  • You can determine your browser supporting various features of HTML5 using http://html5test.com/
  • Not all browsers fully support HTML5 new input types and attribute.

<form id="myform">
    Name: <input name="name" required placeholder="Your name" pattern="[A-z]{10}" />
    <br/>
    Email: <input type="email" name="email" required placeholder="test@domain.com"/>
    <br/>
    URL: <input type="url" name="url" placeholder="Homepage URL"/>
    <br/>
    Age: <input type="number" name="age" min="18" max="99" />
    <br/>
    Description: <textarea name="desc" placeholder="Description text here"></textarea>
    <br/>
    <input type="submit" value="Submit" />
</form>

About the Author

aditya bajaj
Music and Blogging get my love.

Be the first to comment on "HTML5 Form Input Types and Attributes"

Leave a comment

Your email address will not be published.


*