How to get rolling element node in the current web page

The so-called rolling element node, referring to the outermost layer of the rolling element node that can be used with us:. Document.scrollingElement get

document.scrollingElement.nodeName;
// HTML

 

note: 

1. The standard mode of this property returns the node is HTML , return to the compatibility mode body

2. If the element does not exist, return null

 

Guess you like

Origin www.cnblogs.com/aisowe/p/11532589.html