I’m appending some items dynamically to an unordered list, but the jQuery .append() function only appends to the bottom of the list, like this:
- Appended 1
- Appended 2
- Appended 3
- Appended 4
But what I want to do is append like this:
- Appended 4
- Appended 3
- Appended 2
- Appended 1
How can I do this?
You don’t want to ap-pend, you want to pre-pend! For this, funnily enough, you can use the
prependmethod.