How to write a jQuery selector with multiple :eq's in single expression?

后端 未结 2 1301
甜味超标
甜味超标 2021-01-03 22:55

I have a quick question. How do I write a jQuery selector expression with multiple :eq() selectors? I want to go down the DOM tree but every hope isn\'t uniform. Here is wha

2条回答
  •  误落风尘
    2021-01-03 23:24

    I believe that you could do the following and it should return all dom elements that match:

     $('div:eq(0), div:eq(1), div:eq(5)')
    

    You could then iterate over the results returned, hope this helps.

提交回复
热议问题