【发布时间】:2012-05-03 07:46:22
【问题描述】:
我不知道怎么称呼它,但让我称之为半内部文本。
例子
<div id='myDiv'>
This is the semi-inner text
<div id='other'></div>
This is the semi-inner text
<div>
我想使用 jquery 删除/替换那些 This is the semi-inner text。
我该怎么做?
【问题讨论】:
-
将其包裹在
<span class="semiTxt"></span>中并使用JS替换其中的文本 -
你应该用 span、div、p 或其他东西来包装它。如果某些文本未包装,则它不是有效的 html 页面。
标签: jquery html text tags innerhtml