dom manupulatioin

This commit is contained in:
Elisha 2025-10-28 22:44:44 +06:00
parent 32189f86a2
commit 465e77de4c
2 changed files with 21 additions and 0 deletions

View file

@ -481,3 +481,10 @@ function startServer(port: number): void {
// Start the server
startServer(8080);
function foo(blaz: {
oddly: "long" | "type";
but: "hey" | "this" | "is" | number;
}) {}
function new_fn(bar: number) {}

View file

@ -55,3 +55,17 @@ const f = (
const $root = document.getElementById("root");
$root.appendChild(createElement(f));
function removeBooleanProp($target, name) {
$target.removeAttribute(name);
$target[name] = false;
}
function removeProp($target, name, value) {
if (isCustomProp(name)) {
return;
} else if (name === "className") {
$target.removeAttribute("class");
} else if (typeof value === "boolean") {
removeBooleanProp($target, name);
}
}