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-5 text-center "> <h3>Bootstrap uncheck/reset Radio Button</h3> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="stateRadio" id="radio1" value="Alabama"> <label class="form-check-label" for="radio1">Alabama</label> </div> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="stateRadio" id="radio2" value="Alaska"> <label class="form-check-label" for="radio2">Alaska</label> </div> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="stateRadio" id="radio3" value="Arizona"> <label class="form-check-label" for="radio3">Arizona</label> </div> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="stateRadio" id="radio4" value="Arkansas"> <label class="form-check-label" for="radio4">Arkansas</label> </div> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="stateRadio" id="radio5" checked value="California"> <label class="form-check-label" for="radio5">California</label> </div> <button id="uncheck-btn" class="btn btn-danger">Uncheck</button> </div> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js"></script> <script> $(document).ready(function () { $('#uncheck-btn').click(function () { $('input[name=stateRadio]').prop('checked', false); }); }); </script> </body> </html>