How to append a listitem in first position of list using Jquery?
<ul id="mylist">
<li>First</li>
<li>Second</li>
<li>Third</li>
<li>Fourth</li>
</ul>
is it possible to append a list item before first <li>
with jquery. I try to $('#mylist li:eq(1)').before("<li></li>")
. But it not works?
$('#mylist').prepend('<li></li>')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With