This is my HTML code.
<div id="ulgallery">
<ul class="row">
<li> some item1 </li>
<li> some item1 </li>
<li> some item1</li>
</ul>
<ul class="row">
<li> some item2 </li>
<li> some item2 </li>
<li> some item2 </li>
</ul>
</div>
I have a background ajax program which fetches more
<ul> ...</ul> <ul> ...... </ul>
data as string. I have a problem in appending this data after the last element.
the final code should look like:
<div id="ulgallery">
<ul class="row">
<li> some item1 </li>
<li> some item1 </li>
<li> some item1</li>
</ul>
<ul class="row">
<li> some item2 </li>
<li> some item2 </li>
<li> some item2 </li>
</ul>
<ul class="row">
<li> some item3 </li>
<li> some item3 </li>
<li> some item3 </li>
</ul>
<ul class="row">
<li> some item4 </li>
<li> some item4 </li>
<li> some item4 </li>
</ul>
</div>
That is calling the background program gets more data which should append to that last item of . I am not sure how to convert string to node
document.getElementById("ulgallery").appendChild(node);