根节点ownerDocument

DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>根节点ownerDocumenttitle>
    
head>
<body>
    <div>
        <main>
            <nav>
            nav>
        main>
    div>
    <script>
        var nav=document.getElementsByTagName("nav")[0];//获取nav
        console.log(nav.ownerDocument);//#document
    script>
body>
html>

你可能感兴趣的:(根节点ownerDocument)