Skip to content
Related Articles

Related Articles

jQuery UI Slider widget() Method

Improve Article
Save Article
Like Article
  • Last Updated : 03 Dec, 2021

The jQuery UI consists of GUI widgets, visual effects, and themes implemented using jQuery, CSS, and HTML. jQuery UI is great for building UI interfaces for the webpages. The jQueryUI provides us a slider control through slider widget. Slider helps us to get a certain value using a given range. In this article we will see how to use widget Method in jQuery UI slider. The widget Method is used to returns a jQuery object containing the slider.


var a = $( ".selector" ).slider("widget");

Parameters: This method does not accept any parameter.

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

<link href = “” rel = “stylesheet”>

<script src = “”></script>

<script src = “”></script>

Example: In this example, we will be using the widget method that will return a jquery object.


<!DOCTYPE html>
<html lang = "en">
      <meta charset = "utf-8">
      <link href
            rel = "stylesheet" />
      <script src
      <script src
         $(function() {
            $( "#gfg" ).slider();
               $( "#gfg" ).slider("value");
         function gfgg(){
            var a = $( "#gfg" ).slider("widget");
      <h2>jQuery UI | slider widget method</h2>
      <div id = "gfg" onclick="gfgg()"></div>



My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!