如何在警报或确认框中显示粗体文本?
如何获取粗体文本并更改警报或确认框中文本的颜色?
var conFrm = confirm("Following List(s) already Sent...!\n<strong>List Name: </strong>"+ss.replace(",","\n<b>Name: </b>")+"\n Do you want to send again...!");
How to get BOLD Text and change color of text in Alert or Confirm box?
var conFrm = confirm("Following List(s) already Sent...!\n<strong>List Name: </strong>"+ss.replace(",","\n<b>Name: </b>")+"\n Do you want to send again...!");
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
你做不到。但您可以使用自定义警报和确认框。
您可以在此处阅读有关一些用户界面库的信息:
http://speckyboy.com/2010/05/17/15-javascript-web-ui-libraries-frameworks-and-libraries/
最常见的库是:
You can't do it. But you can use custom Alert and Confirm boxes.
You can read about some User Interface libraries here:
http://speckyboy.com/2010/05/17/15-javascript-web-ui-libraries-frameworks-and-libraries/
Most common libraries are:
将此函数添加到您的源中:
调用方式如下:
在此处了解更多相关信息: https://github.com/davidkonrad/toUnicodeVariant
Add this function to your source:
Call it like:
Read more about this here: https://github.com/davidkonrad/toUnicodeVariant
alert()
对话框不是以 HTML 形式呈现的,因此您嵌入的 HTML 毫无意义。您需要使用自定义模式来实现这一点。
The
alert()
dialog is not rendered in HTML, and thus the HTML you have embedded is meaningless.You'd need to use a custom modal to achieve that.
也许你可以使用 UTF8 粗体字符。
例如:
https://yaytext.com/bold-italic/
它适用于 Chromium 80.0,但我不适用于知道在其他浏览器上...
Maybe you coul'd use UTF8 bold chars.
For examples:
https://yaytext.com/bold-italic/
It works on Chromium 80.0, I don't know on other browsers...