smtp-chide.js 489 B

123456789101112131415
  1. document.addEventListener("DOMContentLoaded", () => {
  2. const checkbox = document.querySelector(".custom-smtp-checkbox");
  3. const custom_smtp_form = document.querySelector(".custom-smtp-form");
  4. const visible_update = () => {
  5. if (checkbox.checked) {
  6. custom_smtp_form.style.display = "";
  7. } else {
  8. custom_smtp_form.style.display = "none";
  9. }
  10. };
  11. visible_update();
  12. checkbox.addEventListener("click", visible_update);
  13. });