考虑两个字符串:
name = "Hello"
mess = "Whats up"
现在进入工具提示类,我试图添加一个attr
标签,如下所示:
$(this.el).find('.checkcalls').attr('title', "#{name}<br/>#{mess}")
此打印:
"Hello<br/>Whats up"
我不想打印break标签,而是执行它。
我尝试过:
$(this.el).find('.checkcalls').attr('title', '#{name}<br/>#{mess}')
和:
$(this.el).find('.checkcalls').attr('title', '"#{name}"<br/>"#{mess}"')
他们没有打印出期望的结果。
我该如何实现?
答案 0 :(得分:0)
不要使用br-请改用\ n:
JDBC Request
我不知道主干,但是应该可以。
找到答案here,这是真的-它是如此简单!只需添加一个实际的按输入键的换行符即可!
$(this.el).find('.checkcalls').attr('title', '"#{name}"\n"#{mess}"');