Home  »  CodeSnippets   »   Bootstrap Show Modal jQuery Example

Bootstrap Show Modal jQuery Example

Posted: February 8, 2022 | by Michael Bright

Show the modal:

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

Toggle the modal. This will show the modal if it is hidden.

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

Using vanilla JavaScript:

<script>
   var myModal = new bootstrap.Modal(document.getElementById('modalID'));
   myModal.show();
</script>

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