Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

jQuery UI Spinner disabled Option

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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 spinner widget helps us to increment and decrement values of an input element using up and down arrow. In this article, we will see how to use the disabled Option in jQuery UI slider. The disabled Option is used to disable jQuery UI spinner. By default, the value is false.

Syntax:

$( ".selector" ).spinner(
   { disabled: boolean}
);

Parameters: This options accepts a single parameter as mentioned above and described below:

  • boolean: This parameter holds the true and false value.

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

<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 1: In this example, we will set the disabled Option as true. It will disable the spinner.

HTML




<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <link href=
              rel="stylesheet" />
        <script src=
        </script>
        <script src=
        </script>
  
        <script>
            $(function () {
                $("#gfg").spinner({ disabled: true });
            });
        </script>
    </head>
  
    <body>
        <h1>GeeksforGeeks</h1>
        <h2>jQuery UI | spinner disabled Option</h2>
        <div id="geeks">
            <input type="text" id="gfg" value="12" />
        </div>
    </body>
</html>


Output:

Reference: https://api.jqueryui.com/spinner/#option-disabled


My Personal Notes arrow_drop_up
Last Updated : 03 Dec, 2021
Like Article
Save Article
Similar Reads