Closing a stacked modal via javascript
Hi!
I have a stacked modal on my page, and I want to close it by javascript.
I´m using the modal.hide() but nothing is happening. 
<div class="modal fade" tabindex="-1" id="modal_stacked_nova_colecao"></div> I initialized the stacked modal:
modalColecao = new bootstrap.Modal(document.querySelector("#modal_stacked_nova_colecao")); And I´m trying to hide using:
modalColecao.hide(); // Hide modal <pre lang="html"> </pre>
See the code here please:
<a>
Replies (3)
Hello,
Really nice posting and very useful for Prestige Evergreen.
Thanks.
Hi,
Can you share your test URL so we can check it online and see the JS console?
Have you checked modalColecao variable before calling the hide method? Is it initialized and represents a valid Modal object?
Regards.
This might help you
https://devs.keenthemes.com/question/metronic-bootstrap-instance-is-undefined