【发布时间】:2011-06-30 14:52:43
【问题描述】:
我想用实际的 html 替换标签 span.textReplace
假设我有一个字符串 dom,看起来像这样:
<div id="content">
hello world <span id="query1" class="textReplace">Query 1</span><br/>this is a test <span id="query2" class="textReplace">Query 2</span> this is <b>another</b> test <span id="query3" class="textReplace">Query3</span> finished
</div>
我希望#content 的 html 看起来像这样:
hello world Query1
这是一个测试 Query2 这是另一个测试 Query3 已完成。
【问题讨论】:
-
“实际 Html”是什么意思?只要
.textReplace没有定义,您的 html 就已经输出了您想要的输出。