Reputation: 7061
Hi I am trying to update a div with some html from another div.
var results = document.getElementsByClassName("myclass");
$("resultsDiv").update(results);
I then get this: [object HTMLCollection] How do I convert it to a string so it is shown as html in my div ?
Cheers
Upvotes: 0
Views: 3466
Reputation: 41229
you can just copy and paste the innerhtml.
var data = div1.innerHTML;
div2.innerHTML=data;
otherwise you have to deal with all the altering of DOM nodes,
Upvotes: 2