aspx Tutorial

NET Articles,jQuery demo, with jQuery, online tutorial,Jquery, SilverLight, Javascript,,JSON, MVC,.NET Articles,demo, Web Services,
Advertise Here


Get our toolbar!


Posted by Aamir Hasan   on Thursday, September 20, 2012 Total Views:  

In this example, you will see how to drag and drop items from one list to another list using jQuery UI plugin. Jquery UI plugin provides Sortable method, by using this method you can drag and drop items from one list to another. Let’s start.   Add the following jquery and jquery UI plugin reference inside the head section of HTML page.

<script src=""


    <script src= 

I have written some css classes to apply some design on the lists and table. You can add your own CSS.

  <link href="Style.css" rel="stylesheet"/>

You can find style.css from below

Add the following jquery script which will sort the two connected list and click method which will display all list one items (index no, list id and link text) inside the table on click on submit button.  

<script type="text/javascript">

        $(function () {

            $("#contentLeft ul, #contentright ul").sortable({

                connectWith: ".connectedSortable",

                placeholder: "ui-state-highlight"


            $("#idsubmit").click(function () {

                var msg = $("#table1 > tbody");

                var list = $("#contentLeft ul li");


                $(list).each(function (index) {

                    $(msg).append("<tr><td>" + index + "</td><td> " +
this).closest("li").prop("id") + "</td><td> " +
this).text() + "</td></tr>");






  The following are HTML tags.  

<div id="content">

            <div class="edit-mu-li" id="contentLeft">


                <ul class="connectedSortable ui-sortable">

                    <li id="1"><a href="#">Link 1</a></li>

                    <li id="2"><a href="#">Link 2</a></li>

                    <li id="3"><a href="#">Link 3</a></li>

                    <li id="4"><a href="#">Link 4</a></li>


            <div class="edit-mu-li" id="contentright">


                <ul class="connectedSortable">

                    <li id="5"><a href="#">Link 5</a></li>




                <input type="button" id="idsubmit"value=" Submit "/>


            <table id="table1">












Drag-and-drop-items-List.rar (2.36 kb)

See live demo

Protected by Copyscape Online Plagiarism Tool

Comments (1) -

real psychic reading
real psychic reading United States
9/10/2015 8:15:56 PM #

Sagittarius This is a two steps forward, 1 stage back, one step down the Rabbit Hole sort of 7 days. The first one will deal with the common situation and query. Another special present of Gemini is youthfulness.

Pingbacks and trackbacks (1)+

Add comment

  Country flag

  • Comment
  • Preview

Advertizement 1
Advertizement 2
Advertizement 3
Advertizement 4
Advertizement 5