close bootstrap modal with javascript

To close a Bootstrap modal with JavaScript, you can use the hide method provided by Bootstrap. Here's an example:

var myModal = new bootstrap.Modal(document.getElementById('myModal'));
myModal.hide();

In this example, myModal is an instance of the Bootstrap Modal class, and document.getElementById('myModal') is the DOM element representing the modal you want to close. You can replace 'myModal' with the actual ID of your modal.

Please note that you need to have the Bootstrap JavaScript library included in your project for this code to work.