how to trigger data-dismiss="modal" using javascript code example Example: close bootstrap modal with javascript $('#myModal').modal('hide');