That is a jquery plugin, which emulates HTML5 Form behavior on the legacy browsers.

The plugin also allows to customize form submission validation tooltips and field validation callbacks (e.g. via XMLHttpRequest)

Currently the plugins serves following input types: text, email, url, number, tel and following input properties: novalidate, placeholder, required, autofocus, pattern, min, max

To enable the shim you simply have to include jQuery and this plugin.

See details on how top use HTML5 form at html5rocks.com

Styling

Take in the account that legacy browsers ignore CSS pseudo-classes :focus, :invalid, :valid, so use instead classes focus, invalid, valid.

NOTE: The examples below use CSS3 styles. If you want your forms not only behave, but look the same in all browsers, use simple styles

Example 1: Custom form submission validation

This form shows custom tooltips as on old browsers as well as on those supporting HTML5.

To make the form showing your custom tooltip on submission validation, define data-custom-validation property on the form element.

The plugin will use $.setCustomValidityCallback to disaply validation messages. You can override this callback with your own function:

If you need your custom text for validation message, please use $(input).setCustomValidity instead of input.setCustomValidity:

Example 2: Custom input type validation

Using the plugin you can define your own input validator:

Example 3: With custom oninput callback

HTML5 introduces a new event oninput, which can be handled to perform additional validation tests on a field. For example, making registration form you can define a handler which checks by XMLHttpRequest if the given email already exists in DB. Here an example for a cross-browser oninput handler: