我有例如这个:
<td "class=name">
<span class="removed">one</span>
<span class="added">two</span>
</td>
或这个:
<td class=name> one
<span class="removed">two</span>
<span class="added">three</span>
</td>
或这个:
<div>
one
<span class="added">two</span>
three four
<span class="removed">five</span>
six
</div>
并想用 JavaScript(不带 JQuery)将其更改为:
<td "class=name">
two
</td>
或这个:
<td class=name>
one
three
</td>
或这个:
<div>
one
two
three
four
six
</div>
想不通。只发现了很多jquery的东西,比如replaceWith等,但需要纯javascript