1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-07-01 04:12:14 +02:00
This commit is contained in:
2023-08-22 16:30:03 +02:00
parent 9ee4a36530
commit 7a17fa8e35
4 changed files with 187 additions and 0 deletions

16
test/index.html Normal file
View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- DEL CSP https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP | https://github.com/Prinzhorn/minimal-csp -->
<!-- DEL https://github.com/jensimmons/cssremedy -->
<link rel="stylesheet" href="https://github.com/jensimmons/cssremedy/raw/master/css/remedy.css">
<title>Small DOM element creation enhancements</title>
<meta name="description" content="Making creatig elements easier">
<script src="index.js" type="module"></script>
</head>
<body>
</body>
</html>

17
test/index.js Normal file
View File

@ -0,0 +1,17 @@
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" })
)
);