jQuery - how to check if two elements are the same?

前端 未结 4 561
感情败类
感情败类 2020-12-16 09:59

I need to pass an element to a function and then match that specific element while traversing parent. The catch (for someone clueless like me) is that this element doesn\'t

4条回答
  •  天命终不由人
    2020-12-16 10:07

    Use isEqualNode to check if two elements have the same markup

    this.isEqualNode(element)
    

    Or use isSameNode to check if two elements are the same DOM node

    this.isSameNode(element)
    

提交回复
热议问题