diff --git a/src/Component.ts b/src/Component.ts index a1971a4..07ef1c0 100644 --- a/src/Component.ts +++ b/src/Component.ts @@ -89,6 +89,15 @@ export class Component extends ElementCompo return new Component(element); } + /** + * Test whether the element would be selected by the specified + * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_selectors CSS selector}, or group of CSS selectors. + * @param selectors + */ + public is(selectors: string): boolean { + return this.node.matches(selectors); + } + /** * Set style property * @param name Property name