close bootstrap modal with javascript

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

Also in JavaScript: