使用保存和放弃按钮确认
我们如何在 JavaScript 中创建一个带有保存和放弃按钮的确认警报? 如果我们使用该代码,
confirm('Do you want to save it?');
我们将收到一个带有“确定取消”的警告框。 如何让ok按钮的文字为保存,另一个为放弃?
How can we create a confirmation alert in javascript with a save and discard button in it?
If we use the code
confirm('Do you want to save it?');
We will get an alert box with ok cancel.
How can we make the text of ok button as save and the other as discard?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您无法修改默认的 javascript 方法“confirm”。但是,您可以覆盖它,例如使用 jQuery UI 对话框:
You cannot modify the default javascript method "confirm". But, you can override it, for example, with jQuery UI dialog:
这是不可能的
更多答案
this is not possible
more answers