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
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
03 Dec, 2021
Like Article
Save Article