kriszyp / put-selector

A high-performance, lightweight function for creating and manipulating DOM elements with succinct, elegant, familiar CSS selector-based syntax
Other
290 stars 39 forks source link

Text content siblings #33

Closed caph1993 closed 2 years ago

caph1993 commented 2 years ago

Hello, is it possible to generate the following tree using put syntax?

<div>Hello <b>text</b> world</div>

The issue is that the div element has two text children, "Hello " and " world", but the dollar sign syntax $ seems to be designed to accept only one.

rtasarz commented 2 years ago

Do you mean something like: put('div $ b $ < $', 'Hello' , 'text', ' world') ?

caph1993 commented 2 years ago

Yes, that's exactly what I meant. Thank you.