Skip to content
Related Articles

Related Articles

How to disable a jQuery-ui draggable of widget ?

Improve Article
Save Article
  • Last Updated : 21 Sep, 2021
Improve Article
Save Article

In this article, we will see how to disable draggable widget using jQuery-ui. The jQuery UI consists of GUI widgets, visual effects, and themes implemented using HTML, CSS, and jQuery. jQuery UI is great for building UI interfaces for the webpages. The jQuery UI Draggable disabled Option is used to disable the draggable element if its value is set to true.


$( ".selector" ).draggable({
   disabled: true/false

CDN Link: First, add jQuery UI scripts needed for your project.

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



<!doctype html>
<html lang="en">
    <meta charset="utf-8">
    <link rel="stylesheet" href=
    <script src="//"></script>
    <script src="//">
        How to disable jQuery-ui draggable widget ?
        #div_element {
            width: 150px;
            height: 150px;
            background: green;
            display: flex;
            justify-content: center;
            align-items: center;
            text-align: center;
        <h1 style="color: green;">GeeksforGeeks</h1>
            How to disable jQuery-ui draggable widget?
        <div id="div_element">Div content</div>
        <input type="button" id="disable" 
            value="Disable Draggable Option">
        $(document).ready(function() {
            $(function() {
                    disabled: false
            $("#disable").on('click', function() {
                    disabled: true


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!