替换<spanjQuery中的内容是否存在问题.
我有这个;
<span class='DimensionList'>
some html
</span>
Run Code Online (Sandbox Code Playgroud)
和
$('.DimensionList').html("<b>This is the new html</b>");
Run Code Online (Sandbox Code Playgroud)
我发现在FF中,跨度的内容被添加到.所以新的HTML位于旧的上方.
在IE6中,是的,我必须迎合它,它做的大致相同.
编辑
我编辑了这个问题,以显示替换html中有html
hyb*_*aut 15
由于替换文本中没有标记,请使用text()而不是html():
$('.DimensionList').text("This is the new html");
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
49455 次 |
| 最近记录: |