如何获取body和html元素、documentbody、documentElement

        var myBody = document.body;  // document.getElementsByTagName("body")[0]
        console.log(myBody);
        var myHtml = document.documentElement;
        console.log(myHtml);

猜你喜欢

转载自blog.csdn.net/weixin_43131046/article/details/121564015