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

Related Articles

jQuery UI Spinner max Option

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

max Option in the jQuery UI slider. The max Option is used to set the maximum value in the jQuery UI spinner. By default, the value is null.

Syntax:

$( ".selector" ).spinner(
   { max: number | 'string' }
);

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

Parameters: This option accepts two parameters as mentioned above and described below:

  • number: This parameter holds the number for max value.
  • string: This parameter will be parsed based on the numberFormat and culture options, otherwise it will fall back to the native parseFloat() method.

<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 be using the maximum Option of the spinner as 50.

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( 
               {max: 50}
            );
         });
      </script>
   </head>
     
   <body>
      <h1>GeeksforGeeks</h1
      <h2>jQuery UI | spinner max option</h2>
      <div id = "geeks">
         <input type = "text" id = "gfg" value = "45" />
      </div>
   </body>
</html>

Output:

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


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