domelemjs 1.1.5 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/htmlElems.csv +2 -0
- package/index.js +1066 -22
- package/index.min.js +1 -1
- package/index.min.js.map +934 -20
- package/package.json +1 -1
- package/test/createDOMElem.html +21 -8
package/package.json
CHANGED
package/test/createDOMElem.html
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
/* styling is easy */
|
|
18
18
|
createDOMElem({
|
|
19
|
-
tag:
|
|
19
|
+
tag: h1,
|
|
20
20
|
text: "Hello World!",
|
|
21
21
|
parent: app,
|
|
22
22
|
style: "color: red; background-color: green",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
});
|
|
29
29
|
createDOMElem({
|
|
30
|
-
tag:
|
|
30
|
+
tag: h2,
|
|
31
31
|
text: "It's amazing",
|
|
32
32
|
parent: app,
|
|
33
33
|
style: { color: "red", backgroundColor: "pink" },
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
],
|
|
42
42
|
});
|
|
43
43
|
createDOMElem({
|
|
44
|
-
tag:
|
|
44
|
+
tag: h3,
|
|
45
45
|
text: "I can write style as I want to",
|
|
46
46
|
parent: app,
|
|
47
47
|
style: ["color: red", "background-color: blue"],
|
|
48
48
|
attrs: { id: "title3" },
|
|
49
49
|
});
|
|
50
50
|
createDOMElem({
|
|
51
|
-
tag:
|
|
51
|
+
tag: h4,
|
|
52
52
|
text: "Awesome",
|
|
53
53
|
parent: app,
|
|
54
54
|
style: [{ color: "red" }, { backgroundColor: "green" }],
|
|
@@ -56,18 +56,18 @@
|
|
|
56
56
|
});
|
|
57
57
|
|
|
58
58
|
/* creating a select with 2 options and eventHandler */
|
|
59
|
-
const
|
|
60
|
-
tag:
|
|
59
|
+
const selector = createDOMElem({
|
|
60
|
+
tag: select,
|
|
61
61
|
parent: app,
|
|
62
62
|
attrs: { id: "selector" },
|
|
63
63
|
children: [
|
|
64
64
|
{
|
|
65
|
-
tag:
|
|
65
|
+
tag: option,
|
|
66
66
|
text: "foo",
|
|
67
67
|
attrs: { value: "foo" },
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
|
-
tag:
|
|
70
|
+
tag: option,
|
|
71
71
|
text: "bar",
|
|
72
72
|
attrs: { value: "bar" },
|
|
73
73
|
},
|
|
@@ -77,6 +77,19 @@
|
|
|
77
77
|
cb: (e) => console.log(e.target.value),
|
|
78
78
|
},
|
|
79
79
|
});
|
|
80
|
+
|
|
81
|
+
DOMElem.Create({
|
|
82
|
+
tag: div,
|
|
83
|
+
parent: app,
|
|
84
|
+
children: [
|
|
85
|
+
DOMElem.Create({
|
|
86
|
+
tag: label,
|
|
87
|
+
content: "Write Something",
|
|
88
|
+
attrs: { for: "inputText" },
|
|
89
|
+
}),
|
|
90
|
+
DOMElem.Create({ tag: "input", attrs: { id: "inputText" } }),
|
|
91
|
+
],
|
|
92
|
+
});
|
|
80
93
|
</script>
|
|
81
94
|
</body>
|
|
82
95
|
</html>
|