
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
element-qsa-scope
Advanced tools
Return elements matching a selector relative to the current node
QSA Scope is a polyfill for :scope
support within QSA methods
(#Element.querySelector
and #Element.querySelectorAll
).
<ul>
<li><a>Link</a>
<ul>
<li><a>Sublink</a></li>
</ul>
</li>
</ul>
<script>
li = document.querySelector('ul li')
</script>
By default, QSA methods return any element matching the CSS selector absolutely, similar to the element being matched by #Element.matches
.
li.querySelector('li a'); // returns <a>Link</a> due to it technically matching
Adding scope is especially useful when traversing the DOM.
li.querySelector(':scope li a'); // returns <a>Sublink</a> due to its context
Browser | Native Support | Polyfill Support |
---|---|---|
Android | ✘ | 2.2+ |
Blackberry | ✘ | 7+ |
Chrome | 27+ | 4 - 26 |
Edge | ✘ | 12+ |
Firefox | 32+ | 3.5 - 31 |
Internet Explorer | ✘ | 8 - 11 |
Opera | 15+ | 10 - 14 |
Opera Mini | ✘ | 5+ |
Safari (iOS) | ✘ | 3.2 - 8.4 |
Safari (MacOS) | 6.2+ | 4 - 6 |
Additional tests were run against the latest 3 versions of browsers, including common outliers such as Internet Explorer 8+ and Safari 6+.
1.0.0 (October 13, 2016)
FAQs
Return elements matching a selector relative to the current node
We found that element-qsa-scope demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.