Javascript警报中文本的颜色 [英] Colour of Text in a Javascript Alert

查看:91
本文介绍了Javascript警报中文本的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法改变文本样式,在Javascript Alert框中格式化文本。例如改变它的颜色,使它变得大胆等等?

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

另外,如果有一个警报可用,带有'是','否'按钮而不是'确定'/ '取消'一个?

Also, if there an Alert avalaible with a 'Yes', 'No' button instead of an 'OK'/'Cancel' one?

推荐答案

,我担心这是不可能的。

No, I'm afraid that is not possible.

使用JavaScript,您只能使用3个弹出框: alert prompt 确认

With JavaScript, you are limited to only 3 popup boxes: alert, prompt and confirm.

如果你想制作一个更有特色的弹出窗口,你应该尝试使用一个JavaScript中编写的许多内容,都是从JavaScript库构建的,例如这个

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警报中文本的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆