Find the next element that is not immediate?

前端 未结 6 1409
-上瘾入骨i
-上瘾入骨i 2020-12-17 09:27

I want to find the first span element after class counter, in code something like this:

6条回答
  •  遥遥无期
    2020-12-17 10:05

    I think your method is the best way. And if you feel it doesn't look good just turn it into a plugin:

    jQuery.fn.firstAfter = function(filter){
     return this.nextAll(filter).eq(0);
    }
    

提交回复
热议问题