by
Posted on November 29, 2017
jQuery
// show
$('#MyModal').modal("show");
// hide
$('#MyModal').modal("hide");
Javascript
// show
var modal = document.getElementById("MyModal");
modal.classList.add("in");
modal.style.display = "block";
document.body.classList.add("modal-open");
// hide
var modal = document.getElementById("MyModal");
modal.classList.remove("in");
modal.style.display = "none";
document.body.classList.remove("modal-open");
Read More