javascript 确认框样式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5498988/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 17:24:06  来源:igfitidea点击:

confirm box styling

javascript

提问by prateek

I want to style the confirm box generated by JavaScript. I want the background color of the box to be green and replace ok/cancelwith yes/no. Do you know how to do this ?

我想为 JavaScript 生成的确认框设置样式。我希望框的背景颜色为绿色并替换ok/cancelyes/no. 你知道怎么做吗?

回答by Gary Green

You can't style a confirm();alert -- this is generic to the browser. Instead, look into alternatives such as boxy for jQuery: http://onehackoranother.com/projects/jquery/boxy/

您无法设置confirm();警报样式——这是浏览器通用的。相反,请查看替代方案,例如 jQuery 的 boxy:http: //onehackoranother.com/projects/jquery/boxy/

boxy for jQuery -- asking a question

jQuery 的四四方方——问一个问题

Of course, you can style this in CSS until your heart melts. ;-)

当然,您可以在 CSS 中设置样式,直到您的心都融化了。;-)

回答by ashishjmeshram

You can also use the jQuery dialog box. Check this out jQuery Dialog

您还可以使用 jQuery 对话框。看看这个jQuery 对话框