VOOZH about

URL: https://www.geeksforgeeks.org/jquery/jquery-ui-draggable-widget-method/

⇱ jQuery UI Draggable widget() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

jQuery UI Draggable widget() Method

Last Updated : 23 Jul, 2025

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 Draggable widget() method to return a jQuery object containing the Draggable element. It does not accept any parameter for functioning.

Syntax:

var widget = $( ".selector" ).draggable( "widget" );

Parameter: This method does not accept any parameter.

Return type: This method returns an object value that contains the draggable element.

CDN Link: Add these jQuery Mobile scripts which will be needed for your project.

<link href = "https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel = "stylesheet">
<script src = "https://code.jquery.com/jquery-1.10.2.js"></script>
<script src = "https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>

Example: This example demonstrates the jQuery UI Draggable widget() method.

Output:

👁 jQuery UI Draggable widget() Method
jQuery UI Draggable widget() Method

Reference: https://api.jqueryui.com/draggable/#method-widget

Comment

Explore