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
confirm box styling
提问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/cancel
with yes/no
. Do you know how to do this ?
我想为 JavaScript 生成的确认框设置样式。我希望框的背景颜色为绿色并替换ok/cancel
为yes/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/
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 对话框