HTML and CSS Reference
In-Depth Information
If a user agent cannot compile the regular expression, it is ignored and no validation
will happen on that input. If a user agent does not recognize the pattern attribute, it,
too, is ignored.
For a browser reference chart for pattern attribute support, see Table 3-12 .
Table 3-12. Browser support for the pattern attribute
IE
Firefox
Chrome
Safari
Opera
iOS
Android
10 Platform Preview 2
4+
10+
5+
11+
-
-
For tips on delivering a more consistent cross-browser experience, see
Recipe 3.14 .
See Also
As with the required attribute, to keep up with browser support for pattern , check
http://caniuse.com/form-validation . For a list of commonly used regular expressions, see
http://html5pattern.com .
3.13 Making HTML5 Work in Older Browsers
Problem
You want to make HTML5 input types and attributes work in browsers that do not
support HTML5.
Solution
Use the Modernizr JavaScript library (see http://www.modernizr.com ) to detect support
for specific HTML5 attributes, then develop or use alternate solutions, such as jQuery
UI (see http://jqueryui.com ) , for instances where features are not supported.
Modernizr is a small, open source JavaScript library that detects native
implementations of HTML5 and CSS3 features in browsers. Instead of
performing browser detection in order to determine support, Modernizr
performs individual feature detection. Modernizr is a very reliable way
to detect support for HTML5 form features.
jQuery UI is a library of user interface design pattern implementations.
It is based on and requires the jQuery JavaScript library, which is used
by many of the top sites on the Web, including Google, Amazon,
Twitter, and Microsoft. jQuery makes manipulating the DOM easy, and
jQuery UI gives you easy-to-implement, themeable widgets.
 
Search WWH ::




Custom Search