怎样获取所有style节点

通过 document.styleSheets 获取所有的样式表节点.

document.styleSheets instanceof StyleSheetList;
// true

注意: 

1. 返回的是一个StyleSheetList对象实例;

2. 不能通过document.querySelectorAll('style') 和 document.getElementsByTagName('style') 获取.

原文地址:https://www.cnblogs.com/aisowe/p/11535995.html