CodePudding user response:
Var style=window. GetComputedStyle? Window. GetComputedStyle (document. GetElementById (" myDiv "), null) : document. The getElementById (" myDiv "). CurrentStyle;CodePudding user response:
Var sheet=document. StyleSheets [0];Alert (sheet. CssText);
CodePudding user response:
Solution found, the code below//get all the style tag
Var styleArr=document. QuerySelectorAll (" style ");
//the style of the first tag
Var tem2=styleArr [0]. InnerHTML;