2024-05-17 22:25:10 +02:00
|
|
|
import { el, empty, on } from "deka-dom-el";
|
2023-12-04 18:19:30 +01:00
|
|
|
document.body.append(
|
|
|
|
el(component),
|
|
|
|
el("button", {
|
|
|
|
textContent: "Remove",
|
|
|
|
onclick: ()=> empty(document.body),
|
|
|
|
type: "button"
|
|
|
|
})
|
|
|
|
);
|
2024-05-22 21:43:49 +02:00
|
|
|
import { S } from "deka-dom-el/signals";
|
2023-12-04 18:19:30 +01:00
|
|
|
function component(){
|
2024-05-22 21:43:49 +02:00
|
|
|
const textContent= S("Click to change text.");
|
2023-12-04 18:19:30 +01:00
|
|
|
|
|
|
|
const onclickChange= on("click", function redispatch(){
|
|
|
|
textContent("Text changed! "+(new Date()).toString())
|
|
|
|
});
|
|
|
|
return el("p", textContent, onclickChange);
|
|
|
|
}
|