views:

693

answers:

1

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

+2  A: 

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,

CrazyJugglerDrummer