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 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. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.