on input modal close javascrip code example
Example 1: bootstrap modal popup clear data with out click event
$('#yourModalName').on('hidden.bs.modal', function(event) {
$('#yourModalName').empty();
});
Example 2: open bootstrap modal with javascript
$("#myModal").modal()