如何在jQuery中找到每个$(".tweet li")中的第一个a标记,并使其具有类“toptweet”?
发布于 2012-03-14 12:37:15
$('.tweet li').each(function(){
$(this).find('a').first().addClass('toptweet');
});发布于 2012-03-14 12:39:11
$(".tweet li").each(function(){
$(this).find("a:eq(0)").addClass("toptweet");
});发布于 2012-03-14 12:42:03
$('.tweet li').each(function() {
$(this).find('a:first').addClass('toptweet');
});https://stackoverflow.com/questions/9695992
复制相似问题