I want to move up single items of a list by clicking. I'm using jQuery but it does not work.
<ul>
<li class="item">AAAAA</li>
<li class="item">BBBBB</li>
<li class="item">CCCCC</li>
<li class="item">DDDDD</li>
</ul>
$(".item").click( function(){
var item = $(this);
item.insertBefore(item.before());
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.