title: How add li to ul dynamically through jquery?
body: <p>This is my jsp code :</p>
  
  <pre><code>&lt;div class="demo-1"&gt;
      &lt;ul id="carousel"&gt;&lt;/ul&gt;
  &lt;/div&gt; 
  </code></pre>
  
  <p>To add in this <code>li</code> dynamically to <code>ul</code> I'm am using jquery :</p>
  
  <pre><code>$('#carousel').append('&lt;li&gt;&lt;a href=\"#\"&gt;&lt;img src=\"'+img.toString()+'\" alt=\"image03\"/&gt;&lt;/a&gt;&lt;/li&gt;');
  carousel.add();
  carousel.slideEnd();
  </code></pre>
  
  <p>But whenever I am getting a new image its not appending to the last one instead of that it is showing the first one every time.</p>
  
  <p>Any idea?</p>