# query-selector-contains-node **Repository Path**: mirrors_mapbox/query-selector-contains-node ## Basic Information - **Project Name**: query-selector-contains-node - **Description**: Check whether a node is contained by any other node on the page matching a selector. - **Primary Language**: Unknown - **License**: BSD-2-Clause - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-09 - **Last Updated**: 2025-11-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # @mapbox/query-selector-contains-node [](https://travis-ci.com/mapbox/query-selector-contains-node) Check whether a DOM node is contained by any other node on the page matching a selector, or matches the selector itself. ## Installation ``` npm install @mapbox/query-selector-contains-node ``` This package provides a CommonJS module, so you'll need to be using a bundler (Webpack, Rollup, Browserify, etc.). ## API ### querySelectorContainsNode `querySelectorContainsNode(selector, node)` Returns `true` if any of the `node`'s ancestors match the `selector`. Also returns `true` if the `node` itself matches the `selector`. Otherwise, returns `false`. #### selector Type: `string`. **Required.** A CSS selector suitable for [`document.querySelectorAll()`]. #### node Type: `Node`. **Required.** ## Example Given the following HTML: ```html