Posted By

neal_grosskopf on 10/19/10


Tagged

css javascript


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

neal_grosskopf


Determine CSS Property Support Using Javascript Feature Testin


 / Published in: JavaScript
 

URL: http://www.nealgrosskopf.com/tech/thread.php?pid=74

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

  1. var el = document.createElement("div");
  2. if(typeof el.style.opacity == "string")
  3. {
  4. //Your browser supports the CSS Opacity property";
  5. } else if (typeof el.style.filter == "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  

You need to login to post a comment.