How to implement “prevUntil” in Vanilla JavaScript without libraries?

前端 未结 7 898
遇见更好的自我
遇见更好的自我 2020-12-29 11:32

I need to implement the functionality of jQuery\'s prevUntil() method in Vanilla JavaScript.

I\'ve got several

elements on the same level:
7条回答
  •  有刺的猬
    2020-12-29 12:11

    There is a previousSibling property in the HTML DOM

    Here is some reference

    http://reference.sitepoint.com/javascript/Node/previousSibling

提交回复
热议问题