Select element by index (multiple elements of same class)

前端 未结 4 1266
半阙折子戏
半阙折子戏 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:22

    http://api.jquery.com/eq/

    $("div.item").eq(0) will give you the first element.

提交回复
热议问题