我基本上想动态地将一些样式应用到页面中的所有元素,我知道 document.all 是 IE 专有的,那么,DOM 中的等价物(如果有的话)是什么? DOM 中的 css 是否有等同于 * 的东西?
注意:不想为此使用 JQuery 或任何其他 JS 库,仅使用 JS,谢谢
最佳答案
使用 document.getElementsByTagName('*')
The World Wide Web Consortium给出了此方法的明确说明(搜索 getElementsByTagName)。
关于javascript - DOM 中 IE 的 document.all 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1248517/