Answers for "can i make modal with href html"

1

call modal by id href

<a href="!#" data-toggle="modal" data-target="#login">
</a>
Posted by: Guest on January-04-2021
1

modal pop up html css

var modal = document.querySelector(".modal");
    var trigger = document.querySelector(".trigger");
    var closeButton = document.querySelector(".close-button");

    function toggleModal() {
        modal.classList.toggle("show-modal");
    }

    function windowOnClick(event) {
        if (event.target === modal) {
            toggleModal();
        }
    }

    trigger.addEventListener("click", toggleModal);
    closeButton.addEventListener("click", toggleModal);
    window.addEventListener("click", windowOnClick);
Posted by: Guest on February-18-2021

Browse Popular Code Answers by Language