Jquery 获取an的所有内容<;a>;用一类.profile链接标记并打印出来

Jquery 获取an的所有内容<;a>;用一类.profile链接标记并打印出来,jquery,class,Jquery,Class,需要关于jquery代码的帮助吗?该代码获取所有标记的所有内容,该标记的类为.profile link??打印出来,因为它们是一堆我不需要的代码,我只需要特定标记中的所有内容尝试$('.profile link').html()如果需要重复使用链接的内容(非转义HTML,视为HTML) $('.profile link').text()若您只是抓取一个字符串。若您想要一个类的标签的所有内容 $('a.profile-link').map(function() { return $(thi

需要关于jquery代码的帮助吗?该代码获取所有标记的所有内容,该标记的类为.profile link??打印出来,因为它们是一堆我不需要的代码,我只需要特定标记中的所有内容

尝试
$('.profile link').html()如果需要重复使用链接的内容(非转义HTML,视为HTML)


$('.profile link').text()若您只是抓取一个字符串。

若您想要一个类的标签的所有内容

$('a.profile-link').map(function() {
    return $(this).text();  // use .html() if you want the html content.
}).get().join("\n"); // joined by newline, you could change to other else.

您是否在
标记之间查找内容?或者
标记的属性,如
href
目标
标题
等?