How to check the feature is available in HTML attributes? - Browser Support

0 votes
60 views
asked May 21, 2016 in HTML5 by admin (8,115 points)
Hi All,

   I want to know whether the feature or functionality is available or not in the HTML attributes. For an example the "orientation" functionality is not available in screen(Safari).

Thanks in advance

1 Answer

0 votes
answered May 24, 2016 by Kadhir

Hi,

  You can try the following piece of code

 if ("orientation" in window.screen){
     console.log("Orientation feature available ")
   }else{
     console.log("Orientation feature not  available ")
   }
...