Open In App

jQuery UI Checkboxradio enable() Method

Improve
Improve
Like Article
Like
Save
Share
Report

jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you are building highly interactive web applications, or you just need to add a date picker to a form control, jQuery UI is a perfect choice.

In this article, we will be using the jQuery UI Checkboxradio enable() method. This method enables the disabled Checkboxradio button. This method does not accept any parameters.

Syntax:

$(".selector").checkboxradio("enable");

CDN Link: First, add jQuery UI CDN links inside the head section that is needed for your project.

<link rel=”stylesheet” href=”//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css”>
<script src=”//code.jquery.com/jquery-1.12.4.js”></script>
<script src=”//code.jquery.com/ui/1.12.1/jquery-ui.js”></script>

Example: In this example, we will describe how to use the jQuery Checkboxradio enable() method.

HTML




<!DOCTYPE html>
<html>
  
<head>
     <link rel="stylesheet" href=
"//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
    <script src=
"//code.jquery.com/jquery-1.12.4.js">
    </script>
    <script src=
"//code.jquery.com/ui/1.12.1/jquery-ui.js">
    </script>
</head>
  
<body>
    <center>
        <h1 style="color:green;">
            GeeksforGeeks
        </h1>
  
        <h3>jQuery UI Checkboxradio enable() Method</h3>
  
        <label for="radio1">Button 1</label>
        <input type="radio" name="radio" 
               id="radio1" class='radio'>
        <br>
  
        <label for="radio2">Button 2</label>
        <input type="radio" name="radio" 
               id="radio2" class='radio'>
        <br>
  
        <label for="radio3">Button 3</label>
        <input type="radio" name="radio" 
               id="radio3" class='radio'>
        <br><br>
  
        <input type="button" id="btn" 
               value="Enable CheckboxRadio" 
               style="padding: 8px">
          
        <script>
            $(document).ready(function () {
                $(".radio").checkboxradio();
                $(".radio").checkboxradio("disable");
                $("#btn").on('click', function() {
                    $(".radio").checkboxradio("enable");
                })
            });
        </script>
    </center>
</body>
</html>


Output:

 

Reference: https://api.jqueryui.com/checkboxradio/



Last Updated : 14 May, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads