【发布时间】:2012-11-19 15:48:50
【问题描述】:
我有这个代码:
$('#output').html("<strong>id:</strong>"+id);
然后
<div id="output">this element will be accessed by jquery and this text replaced</div>
上面的工作正常,但我需要的是输出进入警报所以....
<a href="#" onclick="alert('OUTPUT GOES HERE')">Alert Me</a> <- See here
如何做到这一点?
【问题讨论】:
-
仅供参考
<b>将被弃用 -
@banzsh - 你能记录下这个声明吗?
-
您的意思是希望 html 在警报中可见
-
@banzsh:这是不正确的。请参阅this answer 至 Will the <b> and <i> tags ever become deprecated?
-
我可能是错的,但我很确定我在 w3c 规范上读过它现在找不到。但是,我希望样式只在样式表中,而不是在 html 和样式表中 :) 干杯
标签: javascript jquery