【发布时间】:2017-06-13 07:16:44
【问题描述】:
我想在</b>标签之后剪切文本。
例如,
<div class="quote"><b> Quote from: Bob </b>
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.</div>
应该被截断为
<div class="quote"><b> Quote from: Bob </b>
我该如何存档?
这是我想出的:
【问题讨论】:
-
为什么不直接使用
$(".quote b").text() -
您的问题似乎不完整。你应该告诉我们:当里面没有
<b>标签,当它里面有超过1个<b>标签,当它里面有其他标签但没有<b>s时,这是如何修剪的。跨度>
标签: javascript jquery truncate