How to detect a particular feature through JavaScript with HTML



Use Modernizr in HTML to detect a feature like audio through JavaScript:

if (Modernizr.audio) {
   /* properties for browsers that
   support audio */
} else{
   /* properties for browsers that
   does not support audio */
}

Advertisements