Determine CSS Property Support Using Javascript Feature Testin

/ Published in: JavaScript
Save to your folder(s)

Learn how to test for CSS property support in specific browsers using this simple Javascript technique.

Copy this code and paste it in your HTML
  1. var el = document.createElement("div");
  2. if(typeof == "string")
  3. {
  4. //Your browser supports the CSS Opacity property";
  5. } else if (typeof == "string"){
  6. //Your browser doesn't support the CSS Opacity property but does support IE filters";
  7. } else {
  8. //"Your browser doesn't support the CSS Opacity property";
  9. }


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.