W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <body> <h1>Document 对象</h1> <h2>createComment() 方法</h2> <p id="demo"></p> <script> const comment = document.createComment("我的个人意见"); document.body.appendChild(comment); document.getElementById("demo").innerHTML = "此文档中添加了评论,但如您所知,评论是不可见的。"; </script> </body> </html>