1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2024-11-24 17:39:36 +01:00
deka-dom-el/test/index.js

18 lines
490 B
JavaScript
Raw Normal View History

2023-08-22 16:30:03 +02:00
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" })
)
);