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"> <h3>Bootstrap Get Checkbox checked value</h3> <div class="form-check"> <input class="form-check-input" type="checkbox" id="checkbox1" value="value1"> <label class="form-check-label" for="checkbox1"> Checkbox 1 </label> </div> <div class="form-check"> <input class="form-check-input" type="checkbox" id="checkbox2" value="value2"> <label class="form-check-label" for="checkbox2"> Checkbox 2 </label> </div> <div class="form-check"> <input class="form-check-input" type="checkbox" id="checkbox3" value="value3"> <label class="form-check-label" for="checkbox3"> Checkbox 3 </label> </div> <div class="form-check"> <input class="form-check-input" type="checkbox" id="checkbox4" value="value4"> <label class="form-check-label" for="checkbox4"> Checkbox 4 </label> </div> <div class="form-check"> <input class="form-check-input" type="checkbox" id="checkbox5" value="value5"> <label class="form-check-label" for="checkbox5"> Checkbox 5 </label> </div> <button id="getCheckedValues" class="btn btn-primary mt-3">Get Checked Values</button> <div id="checkedValuesContainer" class="mt-3"></div> </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 () { $('#getCheckedValues').click(function () { var checkedValues = []; $('input.form-check-input:checked').each(function () { checkedValues.push($(this).val()); }); $('#checkedValuesContainer').text('Checked Values: ' + checkedValues.join(', ')); }); }); </script> </body> </html>