相关疑难解决方法(0)

在JavaScript DOM中拆分节点内容

我有一个场景,我需要将节点拆分为给定的祖先,例如

<strong>hi there, how <em>are <span>you</span> doing</em> today?</strong>
Run Code Online (Sandbox Code Playgroud)

需要分成:

<strong>hi there, how <em>are <span>y</span></em></strong>
Run Code Online (Sandbox Code Playgroud)

<strong><em><span>ou</span> doing</em> today?</strong>
Run Code Online (Sandbox Code Playgroud)

我该怎么做呢?

html javascript jquery dom

12
推荐指数
1
解决办法
3590
查看次数

标签 统计

dom ×1

html ×1

javascript ×1

jquery ×1