function appendHtml(elem,value){
var node = document.createElement("div"),
fragment = document.createDocumentFragment(),
childs = null,
i = 0;
node.innerHTML = value;
childs = node.childNodes;
for( ; i < childs.length; i++){
fragment.appendChild(childs[i]);
}
elem.appendChild(fragment);
childs = null;
fragment = null;
node = null;
}
document.body.insertAdjacentHTML("beforeend","<h3>你好</h3>")
说明:position是相对于element元素的位置(beforebegin、afterbegin、beforeend、afterend)