📜  jquery each check if last index - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:26.298000             🧑  作者: Mango

代码示例1
var total = $('ul li').length;
$('ul li').each(function(index) {
    if (index === total - 1) {
        // this is the last one
    }
});