Skip to content

0.2.8 usage attributes

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

Attributes?

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

IAttributes describes the interface attributes.

Condition attributes can always be viewed and changed in ._attributes.

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

var d = div()();
d.attributes({ key: 'value' });
console.log(d._attributes); // { key: 'value' }

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

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

div({ key: 'value' })().render(console.log) // <div key="value"></div>
img({ key: 'value' }).render(console.log) // <img key="value"/>
doctype.html({ key: 'value' }).render(console.log) // <!DOCTYPE html key="value"/>

Clone this wiki locally