Friday, August 26, 2011

How to detect HTML5 support

  
There are four basic techniques for detecting whether a browser supports a particular feature.
  1. Check if a certain property exists on a global object (such as window or navigator).
  2. Create an element, then check if a certain property exists on that element.
  3. Create an element, check if a certain method exists on that element, then call the method and check the value it returns.
  4. Create an element, set a property to a certain value, then check if the property has retained its value.
Or you can use Modernizr which is an open-source Javascript library that makes it easy for web designers and helps you to detect the capabilities of the visitor’s browser.

See Also:

0 comments:

Post a Comment