Open In App
Related Articles

jQuery UI Sortable instance() Method

Like Article
Save Article
Report issue

jQuery UI  is a web-based technology and consists of GUI widgets, visual effects, and themes implemented using the jQuery, JavaScript Library. jQuery UI is the best tool for building UI interfaces for the webpages. It can also be used to build highly interactive web applications or can be used to add widgets easily.

In this article, we will be using the jQuery UI Sortable instance() method to retrieve the sortable’s instance object. If the element does not have any associated instance, undefined is returned. It does not accept any parameter for functioning.


var Instance = $( ".selector" ).sortable( "instance" );

Parameter: This method does not accept any parameter.

Return type: This method returns an object value that contains the sortable’s instance object.

CDN Link: The following jQuery Mobile scripts will be needed for your project so we need to add these scripts to your project.

<link rel= “stylesheet” href=””> <script src= “”></script> <script src= “”></script>

Example: This example describes the uses of the jQuery UI Sortable instance() Method.


<!DOCTYPE html>
<html lang="en">
    <meta charset="utf-8">
    <link rel="stylesheet" href=
    <script src=
    <script src=
        #sortable {
            list-style-type: none;
            width: 50%;
        #sortable li {
            margin: 10px 0;
            padding: 0.5em;
            font-size: 25px;
            height: 20px;
            background-color: #7af760;
        #btn {
            margin-left: 50px;
            padding: 0.5;
            font-size: 25px;
            height: 50px;
            width: 50%;
        $(function () {
            $("#btn").on('click', function () {
                var instance = $("#divID").sortable("instance");
        $(function () {
        <h1 style="color: green;">
        <h4>jQuery UI Sortable instance() Method</h4>
        <ul id="sortable">
            <li class="ui-state-default">Geeks1</li>
            <li class="ui-state-default">Geeks2</li>
            <li class="ui-state-default">Geeks3</li>
        <input type="button" id="btn" value="Instance">
        <h4><span id="gfg"></span></h4>



jQuery UI Sortable instance() Method

jQuery UI Sortable instance() Method


Last Updated : 20 Jan, 2022
Like Article
Save Article
Share your thoughts in the comments
Similar Reads