js操作DOM在父元素中的结尾添加子节点注意

impressionHtml=`<img src=${value} alt=""/>`;
 document.getElementById("wrapper").appendChild(impressionHtml);

js向父元素wrapper中的末尾添加 定义好的html,报错:

Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.

在*上找到很好的一个解释:

js操作DOM在父元素中的结尾添加子节点注意

所以js是不能直接传入字符串的,但是jquery的append可以直接传入html字符串。