在像下面的示例这样的 html 中,我需要text I need to select
使用自定义类将部件包装在 span 标记中,但是如何strong
使用 jquery 仅选择不包括其上方标记中的内容的那部分?
<span>
<strong> random gibberish </strong>
text I need to select
</span>
编辑:仅.text()
在父级上使用是行不通的,因为这会将整个内部 html 转换为文本,包括其中的部分strong