Opposite of jQuery's :eq()

前端 未结 5 1591
悲&欢浪女
悲&欢浪女 2020-12-16 09:14

Does anyone know if there exist some kind of selector to select al the elements from a matched set but the one given by the indicated index. E.g.:

$(\"li\").         


        
5条回答
  •  独厮守ぢ
    2020-12-16 10:07

    In addition to the custom selector, you could also implement this as a jQuery plugin:

    $.fn.neg = function (index) {
        return this.pushStack( this.not(':eq(' + index + ')') );
    }
    

提交回复
热议问题