使用document.createComment().
document.body.prepend(document.createComment(‘helloworld‘));
如上所示, 我们在body子元素顶部增加了一个注释节点: <!--helloworld-->
怎样创建并插入一个注释节点
原文:https://www.cnblogs.com/aisowe/p/11546417.html