使用jQuery获取html文档中的链接值?

Pet*_*ter 0 javascript jquery

假设我在表格中有一个链接:

    <td class="ms-vb" width="100%">
<a onfocus="OnLink(this)" href="/Lists/Business%20Divisions/DispForm.aspx?ID=2" onclick="GoToLink(this);return false;" target="_self">Train<img src="/_layouts/images/blank.gif" class="ms-hidden" alt="" width="1" border="0" height="1">
</a></td>
Run Code Online (Sandbox Code Playgroud)

如何通过jQuery获取值Train?

提前致谢.

编辑:我目前从每个链接获取查询字符串值并使用以下代码将它们推送到数组中:

$("table").each(function(index, value) {
    $(this).addClass("table" + index);
});


var hrefs = new Array();
$('.table449').children().children().each(function(){
var link = ($(this).find('a').attr('href'));
var startIndex = link.indexOf(",'");
var endIndex = link.indexOf("');");
if ( startIndex >= 0 && endIndex >= 0 ) {
    var linkID = link.substring( startIndex+2, endIndex );
  hrefs.push(linkID);
}
alert(hrefs);
});
Run Code Online (Sandbox Code Playgroud)

我想要做的是将像Train这样的值存储在另一个数组中.

bre*_*dan 6

很难说这么小的片段.在提供的片段中,这些中的任何一个都可以工作:

$("td a").text();

$(".ms-vb a").text();
Run Code Online (Sandbox Code Playgroud)