jQuery insertAt

Try something like this:

$("#thelist li").eq(3).after("<li>A new item</li>");

With the eq function, you can get a specific index of the elements retrieved…then, insert the new list item after it.

In the above function, I am inserting a new item at position 4 (index 3).

More info about the function at the jQuery Docs

Leave a Comment