1<div class="form-check form-switch"> <input class="form-check-input" type="checkbox" id="flexSwitchCheckDefault"></div>
2<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.bundle.min.js"></script>
3<script>
4const btn = document.querySelector(".form-check-input")
5label = document.querySelector(".form-check-label");
6btn.addEventListener("change", function() {
7 this.checked ? label.innerHTML = "Button Turned On" :
8 label.innerHTML = "Button Turned Off"
9});
10</script>