alert弹窗样式修改

//弹窗提示
window.alerts = alerts = (function () {
    var _alrElem = document.createElement("div");
    _alrElem.className = "error_page";
    var textElem = document.createElement("div");
    textElem.className = "errorText";
    _alrElem.appendChild(textElem)
    return function (_t) {
        _t = _t || '';
        document.body.appendChild(_alrElem);
        textElem.innerHTML = _t;
        _alrElem.style.display = "block";
        var timer = setTimeout(function () {
            if (_alrElem) { document.body.removeChild(_alrElem); }
            clearTimeout(timer);
        }, 2000);
    }
})();
原文地址:https://www.cnblogs.com/echolife/p/13294477.html