Bootstrap modal - close modal when “call to action” button is clicked

后端 未结 5 1993
一向
一向 2021-02-06 20:36

I have a external link inside my modal, and I want the modal to hide after the user has clicked on the link. How do I do that?

Here is my code:

5条回答
  •  感动是毒
    2021-02-06 21:06

    I tried closing a modal window with a bootstrap CSS loaded. The close () method does not really close the modal window. So I added the display style to "none".

        function closeDialog() {
            let d = document.getElementById('d')
            d.style.display = "none"
            d.close()
        }
    

    The HTML code includes a button into the dialog window.

    
    

提交回复
热议问题