【发布时间】:2009-02-26 15:53:06
【问题描述】:
我有如下声明:
btnApply.Attributes.Add("onclick", "alert('Must be a member to Use this Tool')");
有没有办法添加新行。我试过了,但它显示在文本中。此外,我可以添加一个链接来关闭警报并将用户带到另一个页面吗?
我怎样才能用我的例子做到这一点?
当我添加 \n 时,警报没有出现。
【问题讨论】:
-
你的代码使用了魔鬼
eval()。相反,你应该做类似btnApply.Attributes.Add("onclick", function(){alert('Must be a member to Use this Tool')});的事情
标签: javascript