【发布时间】:2016-09-28 09:59:21
【问题描述】:
链接在这里; http://heart.bmj.com/content/early/2016/08/10/heartjnl-2016-310003.long
我有;
<span class="cit-title">
<span class="cit-series-title">Original article
<span class="cit-sep cit-sep-after-article-series-title">:</span>
</span>Pregnancy outcomes in patients with pulmonary arterial hypertension associated with congenital heart disease
</span>
到目前为止我做了什么?
我选择了span.cit-title,但它是innerText
给我;
"Original article: Pregnancy outcomes in patients with pulmonary arterial hypertension associated with congenital heart disease"
我只想得到
"Pregnancy outcomes in patients with pulmonary arterial hypertension associated with congenital heart disease"`
部分。
如何排除带有cit-series-title 类的 span 并获取原始文本?
【问题讨论】:
-
这是stackoverflow.com/questions/6520192/get-text-node-of-an-element 的副本。你会在那里找到你的答案。
-
真的需要这么多跨度吗?
-
我尝试解析 html。所以我不是跨度的作者。 :)
标签: javascript jquery html nextsibling