Skip to content

Commit f97fd58

Browse files
authored
Merge pull request scala-js#345 from er1c/element-matches
Add Element.matches which has all modern browser support
2 parents b1222bf + b66ca65 commit f97fd58

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
@@ -817,6 +817,15 @@ abstract class Element
817817
*/
818818
def insertAdjacentHTML(where: String, html: String): Unit = js.native
819819

820+
/**
821+
* The `matches()` method of the `Element` interface returns `true` if the
822+
* element would be selected by the specified selector string; otherwise, it
823+
* returns `false`.
824+
*
825+
* MDN
826+
*/
827+
def matches(selector: String): Boolean = js.native
828+
820829
/**
821830
* getAttribute() returns the value of the named attribute on the specified element.
822831
* If the named attribute does not exist, the value returned will either be null or ""

0 commit comments

Comments
 (0)