Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

parent.containts js

// check if element has a child node:
const parent = someNode
const child = someOtherNode

if(parent.contains(child)) {
  console.log("yes")
} else {
  console.log("no")
}
 
PREVIOUS NEXT
Tagged: #js
ADD COMMENT
Topic
Name
9+9 =