//remove style sheet var sheetToBeRemoved = document.getElementById(styleID); if (sheetToBeRemoved) { var sheetParent = sheetToBeRemoved.parentNode; sheetParent.removeChild(sheetToBeRemoved); } //add style sheet var sheet = document.createElement('style'); sheet.type = 'text/css'; sheet.id = styleID; sheet.innerHTML = css; document.getElementsByTagName('head')[0].appendChild(sheet) //document.body.appendChild(sheet); //apply element.addClass(modalClass);
0 Comments