tags:

views:

67

answers:

3

I have an empty unordered list in my design. Now I want to add the following to the ul element:

<li>
  <div class="item left">
    <div class="wrap">
      <h2>Test Header1</h2>

      <p>Test Copy</p>

      <p><a class="button" href="#">Click here</a></p>
    </div>

    <img src="images/bubble.jpg" width="248" height="211" class="right" />
  </div>
</li>

With the setInterval, I want to append another li element/content to the ul element without deleting the first li added. How do I achieve this using jQuery?

+5  A: 

Use .append: $('ul').append('<li>....</li>');

vassilis
And a link to the .append function: http://api.jquery.com/append/
istruble
+2  A: 

Look into .append for this, eg: $("ul").append(li_html_here); Just bear in mind that you'll want to specify the ul with more than just $("ul") else you'll append that li to every ul on the page (eg: add an ID).

46Bit
+1  A: 
joberror