开发者

Get last occurance in a <DIV>

I ha开发者_运维知识库ve the following JQUERY:

$(function() {
    $('span .breadcrumb').each(function(){
        $('#footer').addClass($(this).text());
    });
});

So it reads the .breadcrumb and adds the text contained with text to #footer.

However .breadcrumb occurs a number of time with in the breadcrumb navigation, I want it to read just the second value with the class .breadcrumb - Possible?


Last one:

 $("span .breadcrumb:last") 

Second one:

 $("span .breadcrumb:eq(1)") 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜