modal events in bootstrap 4 code example Example 1: modal in bootstrap 4 $('#myModal').modal('toggle') Example 2: modal in bootstrap 4 $('#myModal').modal('hide')