onclick open modal code example

Example 1: onclick open modal jquery

$('#myModal').modal('toggle');
$('#myModal').modal('show');
$('#myModal').modal('hide');

Example 2: onclick open modal jquery

$('#myModal').modal('show');

Example 3: call function on modal open

$('#myModal').on('shown.bs.modal', function (e) {
  // do something...
})

Example 4: bootstrap modal popup




Example 5: html data-target modal

$('#myModal').modal('show')

Example 6: modal html





Tags:

Misc Example