Let's start by using the open source Modernizr project at: http://modernizr.com created by developers Faruk Ates and Paul Irish. According to the website, Modernizr uses feature detection to test the current browser against upcoming features.
The Modernizr concept aims at feature detection instead of browser detection. It is a subtle but important differentiation. Instead of making broad assumptions, the Modernizr approach detects features that browsers support.
head section of your markup. You will then add the class of "no-js" to your