If you want to be sure the is appended after the last li use this

  $(".list li:last").after("<li>item " + (parseInt($(".list
li").length,10) + 1) + "</li>");



On Jul 15, 10:24 am, Eno <symb...@gmail.com> wrote:
> Given this HTML:
>
> <ul class="list"><li>item 1</li></ul>
>
> How would I insert <lI> elements inside the <ul> element after the
> existing <li>? I tried using append() but that created a second <ul>
> element with the new elements inside it after the existing <ul> block.
>
> --

Reply via email to