mirror of
https://github.com/jaandrle/deka-dom-el
synced 2024-11-24 17:39:36 +01:00
18 lines
490 B
JavaScript
18 lines
490 B
JavaScript
|
import { el, elNS, assign } from "../index.js";
|
||
|
Object.assign(globalThis, { el, elNS, assign });
|
||
|
|
||
|
console.log(el("p", { className: "red", textContent: "Hello "}));
|
||
|
console.log(el("p", { className: "red", textContent: "Hello "}) instanceof HTMLParagraphElement);
|
||
|
|
||
|
document.head.append(
|
||
|
el("style", { textContent: `
|
||
|
.red{ color: red; }
|
||
|
` })
|
||
|
)
|
||
|
document.body.append(
|
||
|
el("p", { className: "red" }).append(
|
||
|
el("", { textContent: "Hello " }),
|
||
|
el("strong", { textContent: "World" })
|
||
|
)
|
||
|
);
|