简体   繁体   中英

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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