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
To create a reactive node, use `Reactive` constructor. It accepts initial value and returns an object with `value` property to get/set the value and `onChange` callback to listen for value changes. Checkout [Reactive](./docs/reactive.md) for more details.
43
69
44
-
constelements= [el1, el2, el3];
70
+
```javascript
71
+
importReactivefrom'html-tag-js/Reactive';
45
72
46
-
//append child(s)
47
-
div.append(...elements);
73
+
constcount=Reactive(0);
48
74
49
-
//easily get any child of parent element using get method which
To get reference of the node, use `Ref` constructor. It accepts a callback function which will be called with the node as argument. Checkout [Ref](./docs/ref.md) for more details.
58
86
59
-
tag.get('body');
60
-
tag.getAll('.mydiv');
87
+
```javascript
88
+
importReffrom'html-tag-js/Ref';
61
89
62
-
//parse html string
90
+
constref=Ref(node=> {
91
+
console.log(node); // <h1>Hello</h1>
92
+
});
63
93
64
-
//returns html element
65
-
constel=tag.parse('<div class="mydiv"></div>');
66
-
console.log(el);
94
+
// Change style of the node before or after referencing
0 commit comments