编程语言
首页 > 编程语言> > javascript

javascript

作者:互联网

document.getElementById()

 

<body>
    <div id="time"> 2020-10-2 </div>
    <script>
        var timer = document.getElementById('time');
        console.log(timer);
    </script>
</body>

//控制台输出:<div id="time"> 2020-10-2 </div>

console.dir(变量) //输出详细内容

标签:10,console,javascript,timer,getElementById,2020,document
来源: https://www.cnblogs.com/-Z-R-H-/p/16455749.html