You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of, select two elements. First - any. Second - child of the first element.
Then, just run SelectAll on this array.
Array (as any of js objects) passed by reference and css-select changes it somewhere.
Example:
constCSSselect=require('css-select');const{parseDocument}=require('htmlparser2');constdom=parseDocument('<div class="root"><div class="product"><h1></h1></div></div>');constelements=CSSselect.selectAll('h1, .product',dom);console.log(elements.length);// elements.length === 2// elements contains both h1 AND .product (which are parent of h1)CSSselect.selectAll('no matter',elements);console.log(elements.length);// elements.length become 1// elements contains only .product
The text was updated successfully, but these errors were encountered:
First of, select two elements. First - any. Second - child of the first element.
Then, just run SelectAll on this array.
Array (as any of js objects) passed by reference and css-select changes it somewhere.
Example:
The text was updated successfully, but these errors were encountered: