The html structure looks like this
parent may contain text child 1 may contain text 4条回答 自闭症患者 (楼主) 2020-12-18 22:53 Try this: ($('#parent').text()).replace($('#parent script').text(),''); Check out this Fiddle. 0 讨论(0) 查看其它4个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
Try this:
($('#parent').text()).replace($('#parent script').text(),'');
Check out this Fiddle.