Select element by index (multiple elements of same class)

前端 未结 4 1232
半阙折子戏
半阙折子戏 2021-01-24 16:20

Is there a way to select a element by index with Javascript or jQuery? For instance:

4条回答
  •  抹茶落季
    2021-01-24 16:49

    You could use the .eq() selector for this job:

    var element = $('div.item:eq(3)');
    

提交回复
热议问题