How to find all Siblings of the currently selected DOM object

前端 未结 11 1277
轻奢々
轻奢々 2020-12-08 04:25

What is the perfect way to find all nextSiblings and previousSiblings in JavaScript. I tried few ways but not getting accurate solution. If any element is selected, I need t

11条回答
  •  一生所求
    2020-12-08 05:03

    You can get all of the children of the element's parent, and exclude the element itself.

提交回复
热议问题