How to select a range of elements in jQuery

后端 未结 3 895
庸人自扰
庸人自扰 2020-11-28 08:57
... ... ... ... ...
3条回答
  •  悲&欢浪女
    2020-11-28 09:38

    jQuery slice() function taking indexes of the first and the last needed elements selects a subset of the matched elements. Note what it doesn't include last element itself.

    In your particular case you should use

    $("#myDiv a").slice(1, 4)
    

提交回复
热议问题