Copy code code 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";
// The background color when the dialog box pops up
shield.style.background = "#fff";
shield.style.textalign = "Center";
shield.style.zindex = "25";
// Background transparent IE is 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-alft; padding-left: 20px; font-size: 14px; font-weight: bold; height: 25px; l INE-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; 1px solid Ade; Border-Right: 1px solid #f9cade;/">"+str+"</li>/n";
Strhtml += "<li style =/" background: #fdeef4; text-align: center; font-weight: bold; height: 25px; line-height: 25px; 1px solid #F 9Cade;/"> <input Type =/"Button/" Value =/"OK/" OnClick =/"DOOK ()/"/> </li>/N ";
strhtml += "</ul>/n";
alertfram.innerhtml = strhtml;
document.body.appendchild (alertfram);
document.body.appendchild (shield);
var adj = SetInterval ("DOALPHA ()", 5); 5);
this.Dook = Function () {
alertfram.style.display = "None";
shield. Style.display = "None";
}
alertfram.focus ();
document.body.OnselectStart = Function () {Return false;};
}
The effect is as shown in the figure