简体   繁体   English

警报框中是否可以使用自定义按钮?

[英]Are custom buttons possible in an alert box?

嗨,我一直在寻找在警报框中创建自定义按钮,我希望他们说去和取消而不是确定并取消

onClick="if(confirm('Would you like to continue?'))

不,没有跨浏览器支持打开不是默认确定/取消对的确认对话框,但您可以使用JavaScript构建它们,例如jQuery Alert DialogsjQuery impromptuMootools LightFace等等。

You can't, as far I know. 据我所知,你不能。 The button caption are not customizable by design. 按钮标题不能按设计自定义。

It is needed to avoid possible fraud (think what can happen if you switch the caption of confirm and cancel buttons). 需要避免可能的欺诈行为(想想如果切换确认和取消按钮的标题会发生什么)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM