var fragment = document.createDocumentFragment();
li = document.createElement('li');
li.className = "xxx";
fragment.appendChild(li);
document.getElementById("xx").appendChild(fragment);appendTo()前面是要插入的元素内容且为Jquery对象。而后面是要选择的对象
实例:
$('#a').append('content');
$('<div>content</div>').appendTo($('#a'));
//注意appendTo前面一定要是Jquery对象。 原文:http://www.cnblogs.com/lxjshuju/p/7258846.html