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 */
}

Updated on: 29-Jan-2020

107 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements