Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
var fullreset = (function () {
$(function () {
var iframe = document.createElement("iframe");
var doc = iframe.contentDocument;
var win = iframe.contentWindow;;
var html = "<!DOCTYPE html>\n"+
"<html><body><p>Not Red</p></body></html>";
var p = doc.getElementsByTagName("p")[0];
var curCSS = win.getComputedStyle(p, null)
var text = "#reset p {\n";
for(var i = 0; i < curCSS.length; i++) {
var name = curCSS[i];
text += name+": "+curCSS.getPropertyValue(name)+";\n"
text += "}\n"
$("body").append('<style type="text/css">'+text+'</style>')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.