Each XHTML tag in a component file is represented by an instance of
Each text is represented by an instance of
The base class for both types is
The main tag for a component file or component can be accessed inside
<script /> as
In styles, connected node can be reached using the
All methods available in Virtual DOM are described in the API Reference.
One of the most interesting parts, are querying elements using CSS Selector.
query() to get the first matched element.
queryAll() to get all matched elements.
To find a text, specify
#text in CSS Selector.
<p><span>big</span> yellow <span>dragon</span></p> <script> console.log(this.node.queryAll('p > span > #text')); // [big, dragon] console.log(this.node.queryAll('p #text')); // [big, yellow, dragon] </script>