jQuery UI Library Sortable Simple Example

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

Take any list and add an identifier to the outer wrapper (ul, div)

<ul id="sortable">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
</ul>

In your jquery:

$(function(){
    $('#sortable').sortable({
        //pass all options in here
    });
});

This will allow all the li in the #sortable wrapper to be dragged and dropped in the list



Got any jQuery UI Library Question?