我有以下html格式,
<tr>
<td width="80%" style="padding-bottom: 3px" class="ms-vb">
<span class="ms-announcementtitle">
title is here 3
</span>
<br>
by Ahmed 1
</td>
</tr>
<tr>
<td width="80%" style="padding-bottom: 3px" class="ms-vb">
<span class="ms-announcementtitle">
title is here 2
</span>
<br>
by Ahmed 2
</td>
</tr>
<tr>
<td width="80%" style="padding-bottom: 3px" class="ms-vb">
<span class="ms-announcementtitle">
title is here 3
</span>
<br>
by Ahmed 3
</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
如何使用jQuery获取文本之后<br>ieby Ahmed 1, by Ahmed 2, by Ahmed 3
var text = [];
$('.ms-vb').each(function() {
text.push($(this).html().split('<br>')[1]);
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4713 次 |
| 最近记录: |