deep-query-selector
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Deep query

Support over the ShadowDOM boundary query element.

Add deepQuerySelector and deepQuerySelectorAll method to document and Element, these methods support >>, >>> selector.

Note: DeepQuerySelectorall return array and not sort in DOM Tree.

Install

npm i deep-query-selector

or

import 'https://cdn.skypack.dev/deep-query-selector';

Usage

document.deepQuerySelector('test-parent >> div');
document.deepQuerySelector('test-parent >> .parent');
document.deepQuerySelector('test-parent >> #parent');
parent.deepQuerySelector('>> test-child >> div');
parent.deepQuerySelector('>> test-child >> .child');
parent.deepQuerySelector('>> test-child >> #child');
document.deepQuerySelector('body >>> div');
document.deepQuerySelector('body >>> .child');
document.deepQuerySelector('body >>> #child');
document.body.deepQuerySelector('>>> div');
document.body.deepQuerySelector('test-parent >>> div');
document.body.deepQuerySelector('test-parent >>> .child');
document.body.deepQuerySelector('test-parent >>> #child');

Readme

Keywords

Package Sidebar

Install

npm i deep-query-selector

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

33.4 kB

Total Files

15

Last publish

Collaborators

  • mantou132