我可以添加< br />并链接到javascript警报? [英] Can I add a <br/> and links to a javascript alert?

查看:129
本文介绍了我可以添加< br />并链接到javascript警报?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下声明:

btnApply.Attributes.Add("onclick", "alert('Must be a member to Use this Tool')");

有没有办法添加新行。我试过了,但它在文中显示了。另外,我可以添加一个可以关闭提醒并将用户带到另一个页面的链接吗?

Is there a way to add a new line. I tried, but it showed the in the text. In addition, can I add a link that would close the alert and take the user to another page?

如何使用我的示例执行此操作?

How can I do this with my example?

当我添加\ n时,警报不显示。

When I added the \n, the alert doesn't show up.

推荐答案

您不能使用HTML,但可以添加换行符:

You can't use HTML, but you can add line breaks:

alert('line1\nline2');

如果你想要的是丰富的模态弹出窗口,你可以使用 jQuery的对话框功能,并在那里放置你想要的任何东西。

If a rich modal popup is really what you want though, you can use jQuery's dialog feature and put whatever you want in there.

这篇关于我可以添加< br />并链接到javascript警报?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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