Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

How to disable a jQuery-ui draggable of widget ?

  • Last Updated : 21 Sep, 2021

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.


Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

$( ".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
Recommended Articles
Page :

Start Your Coding Journey Now!