小编ben*_*ske的帖子

使用基于HR标记的Javascript/JQuery在div中拆分HTML

我想基于HR标签拆分我从不同DIV中的Web服务收到的文章(= HTML内容).

我用一个例子解释,这是我从服务中收到的:

<p>This is an article bla bla</p> <hr/> <p>this is the next page of the article blabla ...</p>
Run Code Online (Sandbox Code Playgroud)

我想根据HR标签制作:

<div><p>This is an article bla bla</p></div>
<div><p>this is the next page of the article blabla ...</p></div>
Run Code Online (Sandbox Code Playgroud)

我尝试了不同的想法,但是没有用.我怎么能用Javascript或JQuery(或另一种方法;-))来做到这一点?

html javascript jquery split

3
推荐指数
1
解决办法
4420
查看次数

标签 统计

html ×1

javascript ×1

jquery ×1

split ×1