heroweb/poc/static/js/toggle.js

10 lines
327 B
JavaScript
Raw Normal View History

2024-09-02 05:28:06 +00:00
text = document.querySelector("[profile-visibility-toggle-label]").firstElementChild;
toggler = document.querySelector("[profile-visibility-toggle]");
toggler.addEventListener("change", function () {
if (this.checked) {
text.innerText = "Switch to invisible";
} else {
text.innerText = "Switch to visible";
}
});