Open In App

jQuery Mobile Flipswitch disable() Method

Improve
Improve
Like Article
Like
Save
Share
Report

jQuery Mobile is a web technology used to make responsive websites and apps which are accessible on smartphones, tablets, and desktop devices. In this article, we will be using the jQuery Mobile Flipswitch disable() method to disable the flip switch enabled widget. This method does not accept any parameter.

Syntax:

$(".selector").flipswitch("disable");

Parameters: This method does not accepts any parameters.

CDN Links:  First, add jQuery Mobile scripts needed for your project.

<link rel=”stylesheet” href=”https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css” />
<script src=”https://code.jquery.com/jquery-2.1.3.js”></script>
<script src=”https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.js”></script>

Example: This example describes the jQuery Mobile Flipswitch disable() method.

HTML




<!doctype html>
<html lang="en">
 
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1">
    <link rel="stylesheet"
          href=
    <script src=
    </script>
    <script src=
    </script>
    <script>
    $(document).ready(function() {
        $("#btn").on('click', function() {
            $("#GFG").flipswitch("disable");
        })
    });
    </script>
</head>
 
<body>
    <center>
        <div data-role="page">
            <div data-role="header">
                <h1>GeeksforGeeks</h1>
                <h3>jQuery Mobile Flipswitch disable() Method</h3>
            </div>
            <div class="ui-field-contain">
                <form>
                    <div data-role="fieldcontain">
                        <label for="GFG">
                            Flipswitch Checkbox:
                        </label>
                        <input type="checkbox"
                               id="GFG"
                               data-role="flipswitch">
                    </div>
                </form>
            </div>
            <input type="button"
                   id="btn"
                   style="width: 250px;"
                   value="Disable the Widget">
        </div>
    </center>
</body>
 
</html>


Output:

Flipswitch disable() Method

Reference: https://api.jquerymobile.com/flipswitch/#method-disable



Last Updated : 13 Jan, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads