例如:
从
<div>
whats up!
<div> whats up2! </div>
thank you for your help
<div></div>
</div>
至
<div>
<span>whats up!</span>
<div><span> whats up2! </span></div>
<span>thank you for your help</span>
<div></div> <!---STAYS THE SAME -->
</div>
我将如何在 jQuery 或纯 JavaScript 中制作这样的东西?