onclick open modal jquery

JavaScript
$('#myModal').modal('toggle');
$('#myModal').modal('show');
$('#myModal').modal('hide');$('#myModal').modal('show'); $(window).on('shown.bs.modal', function() { 
    $('#code').modal('show');
    alert('shown');
});$('#my-modal').modal({
    show: 'false'
}); 
Source

Also in JavaScript: