The code is as follows:
Window.alert = function (str)
{
var shield = document.createelement (div);
Shield.id = shield;
Shield.style.position = absolute;
Shield.style.left = 0px;
Shield.style.top = 0px;
Shield.style.width = 100%;
Shield.style.height = document.body.scrollheight+px;
Background color when a dialog box pops up
Shield.style.background = #fff;
Shield.style.textalign = center;
Shield.style.zindex = 25;
Background transparent IE valid
Shield.style.filter = Alpha (opacity=0);
var alertfram = document.createelement (div);
Alertfram.id=alertfram;
Alertfram.style.position = absolute;
Alertfram.style.left = 50%;
Alertfram.style.top = 50%;
Alertfram.style.marginleft = -225px;
Alertfram.style.margintop = -75px;
Alertfram.style.width = 450px;
Alertfram.style.height = 150px;
Alertfram.style.background = #ff0000;
Alertfram.style.textalign = center;
Alertfram.style.lineheight = 150px;
Alertfram.style.zindex = 300;
strHTML = <ul style=\list-style:none;margin:0px;padding:0px;width:100%\>\n;
strHTML + = <li style=\background: #dd828d; text-align:left;padding-left:20px;font-size:14px;font-weight:bold; height:25px;line-height:25px;border:1px solid #f9cade; \>[Custom Prompt]</li>\n;
strHTML + = <li style=\background: #fff; text-align:center;font-size:12px;height:120px;line-height:120px; border-left:1px solid #f9cade, border-right:1px solid #f9cade;\>+str+</li>\n;
strHTML + = <li style=\background: #fdeef4; text-align:center;font-weight:bold;height:25px;line-height:25px; border:1px solid #f9cade; \><input type=\button\ value=\ OK \ onclick=\dook () \/></li>\n;
strHTML + = </ul>\n;
alertfram.innerhtml = strhtml;
Document.body.appendchild (Alertfram);
Document.body.appendchild (shield);
var ad = SetInterval (Doalpha (), 5);
This.dook = function () {
Alertfram.style.display = none;
Shield.style.display = none;
}
Alertfram.focus ();
Document.body.onselectstart = function () {return false;};
}
How the alert style of JS changes, such as the background color