(name, props, children)
| 140 | } |
| 141 | |
| 142 | function element(name, props, children) { |
| 143 | if (arguments.length === 2) (children = props), (props = undefined); |
| 144 | const element = document.createElement(name); |
| 145 | if (props !== undefined) for (const p in props) element[p] = props[p]; |
| 146 | if (children !== undefined) for (const c of children) element.appendChild(c); |
| 147 | return element; |
| 148 | } |
| 149 | |
| 150 | function text(value) { |
| 151 | return document.createTextNode(value); |