sarpay
11/29/2016 - 8:13 AM

Dynamically add/remove html nodes via JavaScript.

Dynamically add/remove html nodes via JavaScript.

function CheckSpeedCss() {
  if (window.localStorage.getItem("fastCss")) {
    addStyleString('fastCss', '* {box-shadow: none !important;}');
  }
}
function addStyleString(id, str) {
  var node = document.createElement('style');
  node.id = id;
  node.innerHTML = str;
  document.body.appendChild(node);
}
function removeStyleString(id) {
  if (document.getElementById(id)) {
    document.body.removeChild(document.getElementById(id));
  }
}