Stop/Re-start

Download CSS Download JS
Stop/Re-start

document.addEventListener("DOMContentLoaded", function(event) {
  const stopMm = document.querySelector("#stopMm");
  const startMm = document.querySelector("#startMm");
  const mm = new MetisMenu("#menu");

  stopMm.addEventListener("click", function(event) {
    mm.dispose();
  });

  startMm.addEventListener("click", function(event) {
    mm.update();
  });
});


Delete elements

function removeElement(node) {
  node.parentNode.removeChild(node);
}

document.addEventListener("DOMContentLoaded", function(event) {
  const deleteElem = document.querySelector("#deleteElem");
  const mm1 = new MetisMenu("#menu1");

  deleteElem.addEventListener("click", function(event) {
    mm1.dispose();
    removeElement(document.querySelector('#menu1 #removable'));

    mm1.update();

    deleteElem.classList.remove("btn-danger");
    deleteElem.classList.add("btn-success");
    deleteElem.innerHTML = "Menu 1 removed";
    deleteElem.setAttribute("disabled", "disabled");
  });
});