Open In App
Related Articles

jQuery UI Tabs disabled Option

Improve Article
Improve
Save Article
Save
Like Article
Like

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. jQuery UI tabs widget helps us to put some content in different tabs and allow us to switch between them. In this article we will see how to use disabled option in jQuery UI slider.
The
disabled option is used to disable the tabs in jQuery UI.

Syntax:

$( ".selector" ).tabs(
   { disabled : true }
);

Parameters:

  • boolean: If it set to true it will disable all the panels.
  • array: An array containing the zero-based indexes of the tabs

Approach: First, add jQuery UI scripts 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 1:

HTML




<!doctype html>
<html lang="en">
  
<head>
    <meta charset="utf-8">
  
    <link href=
        rel="stylesheet">
  
    <script src=
    </script>
      
    <script src=
    </script>
  
    <script>
        $(function () {
            $("#gfg").tabs({
                disabled : true
            });
        });
    </script>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
    <h3>jQuery UI tabs disabled option</h3>
  
    <div id="gfg">
        <ul>
            <li><a href="#gfg1">Tab 1</a></li>
            <li><a href="#gfg2">Tab 2</a></li>
            <li><a href="#gfg3">Tab 3</a></li>
        </ul>
  
        <div id="gfg1">
            <p>tab Number -1</p>
        </div>
  
        <div id="gfg2">
            <p>tab Number -2</p>
        </div>
  
        <div id="gfg3">
            <p>tab Number -3</p>
        </div>
    </div>
</body>
  
</html>


Output:

Example 2:

HTML




<!doctype html>
<html lang="en">
  
<head>
    <meta charset="utf-8">
  
    <link href=
        rel="stylesheet">
  
    <script src=
    </script>
  
    <script src=
    </script>
  
    <script>
        $(function () {
            $("#gfg").tabs({
                disabled: [0, 1]
            });
        });
    </script>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
    <h3>jQuery UI tabs disabled option</h3>
  
    <div id="gfg">
        <ul>
            <li><a href="#gfg1">Tab 1</a></li>
            <li><a href="#gfg2">Tab 2</a></li>
            <li><a href="#gfg3">Tab 3</a></li>
        </ul>
  
        <div id="gfg1">
            <p>tab Number -1</p>
        </div>
  
        <div id="gfg2">
            <p>tab Number -2</p>
        </div>
  
        <div id="gfg3">
            <p>tab Number -3</p>
        </div>
    </div>
</body>
  
</html>


Output:


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 : 08 Feb, 2021
Like Article
Save Article
Similar Reads
Related Tutorials