1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 2 <html xmlns="http://www.w3.org/1999/xhtml">
 3 <head>
 4     <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
 5     <title></title>
 6     <link rel="stylesheet" href="style.css" />
 7     <link rel="stylesheet" href="style1.css" />
 8     <script type="text/javascript" src="test10.js"></script>
 9 </head>
10 <body>
11     
12 </body>
13 </html>
 1 function getStyleSheet(element) {
 2     //非IE、only IE
 3     return element.sheet || element.styleSheet;
 4 }
 5 
 6 var link = document.getElementsByTagName("link")[0];
 7 var sheet = getStyleSheet(link);
 8 
 9 for (var i = 0, len = document.styleSheets.length; i < len; i++) {
10     sheet = document.styleSheets[i];
11     console.log(sheet.href);
12 }

相关文章:

  • 2021-12-30
  • 2022-12-23
  • 2022-01-24
  • 2021-09-11
  • 2021-11-01
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-22
  • 2022-12-23
  • 2021-11-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案