
Modernizr is a JavaScript library that detects support for various HTML and CSS features. While it is possible to do this work yourself, Modernizr does it in an easy-to-use package that is well tested and easily configured. It detects what the browser’s capabilities are and can use JavaScript to add to the DOM the elements and CSS classes that you need. This is known as a polyfill.
Justin James, in this article gives in-depth knowledge about Modernizr. It gives developers the ability to use HTML5 today while addressing concerns about older browsers. The author also discusses some big problems with polyfills. For example at times it can get very heavy.