Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkedSelectorSupport(){
- var d = document.documentElement;
- var t1 = document.createElement("input");
- t1.className = "checkedSelectorSupport";
- t1.type = "checkbox";
- t1.style.display = "none";
- t1.checked = true;
- d.appendChild(t1);
- var t2 = document.createElement("div");
- d.appendChild(t2);
- var t3 = document.createElement("style");
- t3.type = "text/css";
- var rules = ".checkedSelectorSupport + *{display: none;}.checkedSelectorSupport:checked + *{display: block !important;}";
- if(t3.styleSheet) t3.styleSheet.cssText = rules; // IE 8 and earlier
- else t3.innerText = rules;
- d.appendChild(t3);
- var style = t2.currentStyle ? t2.currentStyle : window.getComputedStyle(t2);
- var result = style.display;
- d.removeChild(t1);
- d.removeChild(t2);
- d.removeChild(t3);
- return result;
- }
- checkedSelectorSupport(); // Will return FALSE in IE8 and earlier
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement