Root ownerDocument

<! DOCTYPE HTML > 
< HTML lang = "EN" > 
< head > 
    < Meta charset = "UTF-. 8" > 
    < Meta name = "the viewport" Content = "width = Device-width, Initial-Scale = 1.0" > 
    < Meta HTTP-equiv = "X--the UA-Compatible" Content = "IE = Edge" > 
    < title > root the ownerDocument </ title > 
    <-!  
        all child nodes can use the document ele.ownerDocument; document node acquiring method 
     - ->
</head>
<body>
    <div>
        <main>
            <nav>
            </nav>
        </main>
    </div>
    <script>
        var nav=document.getElementsByTagName("nav")[0];//获取nav
        console.log(nav.ownerDocument);//#document
    </script>
</body>
</html>

Guess you like

Origin www.cnblogs.com/vinson-blog/p/12112731.html