in querySelector: how to get the first and get the last elements? what traversal order is used in the dom?

前端 未结 4 972
太阳男子
太阳男子 2020-12-13 08:03

in a div, have elements (not necessarily 2nd generation) with attribute move_id.

First, would like most direct way of fetching first and last elements o

4条回答
  •  青春惊慌失措
    2020-12-13 08:30

    Example to get the last input element:

    document.querySelector(".groups-container >div:last-child input")

提交回复
热议问题