screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet"> </head> <body> <div class="container mt-4"> <h3>Bootstrap Enable Disable Radio Button</h3> <div class="form-check"> <input class="form-check-input" type="radio" name="exampleRadio" id="radio1" value="option1" checked> <label class="form-check-label" for="radio1"> Option 1 </label> </div> <div class="form-check"> <input class="form-check-input" type="radio" name="exampleRadio" id="radio2" value="option2"> <label class="form-check-label" for="radio2"> Option 2 </label> </div> <button class="btn btn-secondary" id="enableButton">Enable</button> <button class='btn btn-danger' id="disableButton">Disable</button> </div> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script> $(document).ready(function () { // Disable radio buttons $('#disableButton').click(function () { $('input[type="radio"]').attr('disabled', true); }); // Enable radio buttons $('#enableButton').click(function () { $('input[type="radio"]').attr('disabled', false); }); }); </script> </body> </html>