我们在之前的文章中给大家介绍了JavaScript中alert()的使用详解,我们都知道JavaScript中alert()弹出消息对话框,并且alert消息对话框通常用于一些对用户的提示信息,他的样式一直是默认的,那么我能不能修改他的样式呢,今天就带大家学习下JavaScript修改alert样式的方法介绍!
JavaScript修改alert样式的方法介绍
window.alert = function(txt)
{
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";
shield.style.background = "#333";
shield.style.textAlign = "center";
shi
如果觉得《html+修改alert样式 JavaScript修改alert样式的方法介绍》对你有帮助,请点赞、收藏,并留下你的观点哦!