Skip to content

Commit a75727d

Browse files
authored
Merge pull request #316 from tindzk/contains
Node: Add contains()
2 parents 9b61282 + 8dc1f66 commit a75727d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/scala/org/scalajs/dom/raw/lib.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,15 @@ abstract class Node extends EventTarget {
11701170
*/
11711171
def isSameNode(other: Node): Boolean = js.native
11721172

1173+
/**
1174+
* Returns a Boolean value indicating whether a node is a descendant of a
1175+
* given node, i.e. the node itself, one of its direct children (childNodes),
1176+
* one of the children's direct children, and so on.
1177+
*
1178+
* MDN
1179+
*/
1180+
def contains(otherNode: Node): Boolean = js.native
1181+
11731182
/**
11741183
* hasAttributes returns a boolean value of true or false, indicating if the current
11751184
* element has any attributes or not.

0 commit comments

Comments
 (0)