How do I clone a div and write values during a loop?
I have an XML document that I'm looping through and I'm trying to write the values out using a cloned node (I'm not sure that's the best approach).
If this is my sample XML.
<people>
<firstName>John</firstName>
<lastName>Doe</lastName>
<company>A1 Plumbing</company>
</people>
<people>
<firstName>Bill</firstName>
<lastName>Smith</lastName>
<company>A1 Plumbing</company>
</people>
and this is my HTML...
<div id="people">
<div id="firstName"></div>
<div id="lastName"></div>
<div id="company"></div>
</div>
What's the best way to do this? When I try to clone the node I was trying to change the id of the "people" div so I'd have something to reference but that wasn't working well. Should I just try to create everything on the fly and not try to clone? Thanks.