This snippet will solve the problem. Or go to the link to learn more.
$('#mylist').prepend('New Item');
//use jQuery's prepend method.
$('button').on('click',function(){
$('#mylist').prepend('New Item 1 added')
});
- First Item
- Second Item
- Third Item
- Fourth Item