document.write与document.getelementById(),output的作用对象区别

document是获取文档对象也就是当前的html页面。document.write是向页面上打印出内容

document.getElementById()是通过得到html中的id进而来获取到里面的内容

猜你喜欢

转载自www.cnblogs.com/ylsunnny/p/9879720.html