Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Section A.2. Using Modernizr with JavaScript

A.2. Using Modernizr with JavaScript

We can also use Modernizr in our JavaScript to provide some fallback if the visitor’s browser lacks support for any of the HTML5 elements you use.

When Modernizr runs, as well as adding all those classes to your <html> element, it will also create a global JavaScript object that you can use to test for feature support. The object is called, appropriately enough, Modernizr. This object contains a property for every HTML5 feature.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint