Skip to content
Related Articles

Related Articles

jQuery UI Sortable handle Option

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 25 Jan, 2022

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 learn how to use the jQuery UI Sortable handle Option. Using this option, we can use it to restrict the sort start to click to the specified element.


The handle option takes a Selector or Element value and the syntax is as follows.

$( ".selector" ).sortable({
    handle: "handle"
  • Get the handle option

    var handle = $( ".selector" ).sortable( "option", "handle" );
  • Set the handle option

    $( ".selector" ).sortable( "option", "handle ", "handle" );

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 handle Option.


<!DOCTYPE html>
<html lang="en">
    <meta charset="utf-8">
    <link rel="stylesheet"
        #sortable {
            list-style-type: none;
            width: 50%;
        #sortable li {
            margin: 10px;
            padding: 0.5em;
            font-size: 25px;
            height: 20px;
            background-color: green;
            margin-left: 50px;
            margin-left: 50px;
            padding: 0.5;
            font-size: 20px;
            height: 40px;
            width: 40%;
        $(function () {
            $("#btn").on('click', function () {
                var handle = $("#sortable").sortable( "option", "handle" );
                document.getElementById('gfg').innerHTML +=
                "Handle Value : " + handle;
        $(function () {
        <h1 style="color: green;">
        <h3>jQuery UI Sortable handle Option</h3>
        <ul id="sortable">
            <li id='hndl'>Geeks1</li>
        <input type="button" id="btn"
            value="Get Handle">
        <h3><span id="gfg"></span></h3>


jQuery UI Sortable handle Option

jQuery UI Sortable handle Option


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!