Check if div is descendant of another

后端 未结 4 637
灰色年华
灰色年华 2020-12-13 18:04

Best way to find out if element is a descendant of another there is another question, very similiar to this one but its jquery.

so, how do I do it in js ? I have di

4条回答
  •  佛祖请我去吃肉
    2020-12-13 18:53

    You can use node.contains to check if a node contains another node. https://developer.mozilla.org/en-US/docs/Web/API/Node.contains

提交回复
热议问题