[JavaScript] 纯文本查看 复制代码
function addCSSRule(sheet, selector, rules, index) { if(sheet.insertRule) {
sheet.insertRule(selector + "{" + rules + "}", index);
} else {
sheet.addRule(selector, rules, index);
}
}
addCSSRule(document.styleSheets[0], "header", "float: left");