我要插入htmlsnippet到其它HTML元素innerHTML的只是插入[对象HTMLDivElement]
我尝试了这样
在html
<div class="box1">
insert this html element
</div>
<div class="box2">
into this
</div>
js的
var box1 = document.querySelectorAll(".box1")[0];
var box2 = document.querySelectorAll(".box2")[0];
console.log(box1);
box2.innerHTML = box1;
但它不工作它只插入[对象HTMLDivElement],如果我看着它放在控制台ou t正确的html,我做错了什么?
和是我不想使用$ libary;)
http://codepen.io/destroy90210/pen/MKQOwy
感谢;)