//toggle bootstrap modal with jquery
$('#myModal').modal('toggle');
$('#myModal').modal('show');
$('#myModal').modal('hide');
$('#myModal').modal('show');
<script>
var myModal = new bootstrap.Modal(document.getElementById('ModalID'))
myModal.show()
</script>
$('#code').on('shown.bs.modal', function (e) {
// do something...
})