var sheet= document.styleSheets[0];
var rules= sheet.cssRules||sheet.rules;
var rule1= rules[0];
alert(rule1);
//获得和设置link中的style属性,十分的重要
alert(rule1.style.color);
//这样就获得了样式表中的样式
rule1.style.color="yellow";
var sheet= document.styleSheets[0];
rule1.style.color="yellow";