Looping div with jquery
<p>just curious how to loop 'div' from my return json result this is my desire result</p>

<pre><code>&lt;div id="imgdiv"&gt;
  --wanna loop this div and all the inner div and everything as well 
  &lt;div id="rbox" style="display:none"&gt;
    Doa ini telah dihantar sebanyak &lt;span class="counter"&gt;&lt;/span&gt; kali.
    &lt;br/&gt;
    &lt;br/&gt;
    &lt;br/&gt;
    &lt;span class="buttonshare"&gt;&lt;a href=""&gt;Klik untuk pilih doa&lt;/a&gt;&lt;/span&gt;
  &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>and here my current jquery code</p>

<pre><code>$.ajax({type :'GET',
        url : 'getallimg.php',
        dataType : 'json',
        success : function(data){
          $.each(data, function(i,item){
            $("#loader").hide(500);
            $("&lt;div class='imgdiv'&gt;&lt;img src='imagedoa/"+item.imgname+".jpg' width='450' height='150' /&gt;&lt;/div&gt;&lt;/br&gt;")
            .appendTo("#doaimgbox");
           });--&gt;stuck up here 
</code></pre>

<p>here the desire code I'm looking it</p>

<pre><code>&lt;div id="doaimgbox"&gt;&lt;!-- parent div --&gt;

       &lt;!-- looping portion --&gt;
      &lt;!-- I wanna loop this div based on length json return result let's say 3 --&gt;

        &lt;div class="imgdiv"&gt;

            &lt;img src="imagedoa/d0.jpg" width="400" height="150" /&gt;
            &lt;div id="rbox"&gt;
                Was sent &lt;span class="counter"&gt;&lt;/span&gt; times.
                &lt;br/&gt;
                &lt;br/&gt;
                &lt;br/&gt;
                &lt;span class="buttonshare"&gt;&lt;a href=""&gt;Click to select&lt;/a&gt;&lt;/span&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;!-- looping portion --&gt;
</code></pre>

<p> tq</p>

<p>Really need help with it...thanks in advanced</p>
