Home  »  CodeSnippets   »   Bootstrap Hide Modal jQuery Trigger Example

Bootstrap Hide Modal jQuery Trigger Example

Posted: February 8, 2022 | by Site Host

Hide the modal:

$('#myModal').modal('hide');

Toggle the modal. This will hide the modal if it is already shown.

$('#myModal').modal('toggle');

Using vanilla JavaScript:

<script>
   var myModal = document.getElementById('modalID');
   myModal.hide();
</script>

Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.

Share it!

See also  How to Install Ruby and Rails on Mac