Skip to content

0.2.7 usage selector

Ivan S Glazunov edited this page Feb 20, 2015 · 2 revisions

Selector?

All tags may take arguments on the first call, in the first parentheses.

TSelector describes the type selector.

When processing changes the ._attributes.

For ease of, all the tags available method .selector, streaming changes.

var d = div({ class: 'first', key: 'value' })();
d.selector('.second[key=other]');
console.log(d._attributes); // { class: 'first second', key: 'other' }

When extended attributes are applied. Exception - classes, they added.

Usually, all tags can called with a selector of the first pair of brackets.

div('.second[key=other]')().render(console.log) // <div class="second" key="other"></div>
img('.second[key=other]').render(console.log) // <img class="second" key="other"/>
doctype.html('.second[key=other]').render(console.log) // <!DOCTYPE html class="second" key="other"/>

Clone this wiki locally