toggle modal and toggle contents code example
Example 1: javascript modal close
$('#closemodal').click(function() {
$('#modalwindow').modal('hide');
});
Example 2: html data-target modal
$('#myModal').modal('show')
$('#closemodal').click(function() {
$('#modalwindow').modal('hide');
});
$('#myModal').modal('show')