Javascript警报中文本的颜色
16lz
2021-01-22
Is there any way to change style of text, format the text inside a Javascript Alert box. e.g. changing its colour, making it bold, etc.?
有没有办法改变文本样式,格式化Javascript警告框内的文本。例如改变它的颜色,使它变得大胆,等等?
Also, if there an Alert avalaible with a 'Yes', 'No' button instead of an 'OK'/'Cancel' one?
此外,如果有一个警报avalaible与'是','否'按钮而不是'确定'/'取消'按钮?
4 个解决方案
#1
No, I'm afraid that is not possible.
不,我担心这是不可能的。
With JavaScript, you are limited to only 3 popup boxes: alert
, prompt
and confirm
.
使用JavaScript,您只能使用3个弹出框:警报,提示和确认。
If you want to make a more featured popup, you should try using one of the many that exist written in JavaScript, which are built from JavaScript Libraries, such as this
如果你想制作一个功能更强大的弹出窗口,你应该尝试使用JavaScript中编写的众多弹出窗口中的一个,它是从JavaScript库构建的,例如
更多相关文章
- 隐藏加载更多记录按钮ASP.net MVC Ajax Javascript
- 如何更改我的按钮文字?
- 单选按钮单击,隐藏/显示不工作
- 在Internet Explorer中使用sprited按钮和selection.createRange()
- 使用按钮单击按钮添加表格
- 具有相同名称的Mutiple按钮显示不同的div。
- 如何检查不包含提交按钮的HTML5表单的有效性?
- 当函数在单独的PHP文件中定义时,调用JavaScript函数onclick按钮事
- 由ajax [duplicate]生成时,formset的提交按钮不起作用