Showing posts with label attribute. Show all posts
Showing posts with label attribute. Show all posts

Friday, May 31, 2013

Check user's input without js using regular expressions and HTML5 !

HTML5 now allows you to check input attributes of the user using regular expressions without the use of any javascript using "pattern" attribute -

A simple example for email check -

<input type="email" pattern="[^ @]*@[^ @]*" value="">

Thursday, November 1, 2012

Prefetch a link using html5

If you know, where a user might navigate to from your current page, prefetching the page is a good idea.
This has been made really easy by html5 by using the prefetch attribute.

For eg -

<link rel="prefetch" href="http://www.examplesite.com/page2">

Here, the user might be on page 1 of the site and with the help of html5, we can prefetch page 2 before the user even navigates to it making the page load faster.
Smart and simple.