Are custom buttons possible in an alert box?

2019-07-03 22:50发布

Hi I have been looking to create custom buttons in an alert box I would like them to say Go and Cancel instead of OK and cancel

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

3条回答
2楼-- · 2019-07-03 23:10

No, there is no cross-browser support for opening a confirmation dialog that is not the default OK/Cancel pair, but you can build them with JavaScript such as jQuery Alert Dialogs, jQuery impromptu, Mootools LightFace and many more.

查看更多
smile是对你的礼貌
4楼-- · 2019-07-03 23:20

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

查看更多
登录 后发表回答