开发者

Jquery - Get the latest element in a div

开发者 https://www.devze.com 2023-01-17 00:19 出处:网络
somethings somethings somethings somethings somethings How can select (with jquery) the latest element of t开发者_运维技巧his div with classname trackon? (in this case, the #trackline1
somethings somethings somethings somethings somethings

How can select (with jquery) the latest element of t开发者_运维技巧his div with classname trackon? (in this case, the #trackline1) cheers


var latest = $('.tlcontent div:last');
latest.css({color:'red'});

demo


$('.tlcontent').children().last()

If you just what the last thing in content, try:

$('.content :last')

Example: http://jsfiddle.net/Kgp2u/


$(".tlcontent div").last();

0

精彩评论

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