Document manupulation using vanila javascript.
Install Manipulated DOM
to your project.
pnpm install manipulated-dom
Import statement Manipulated DOM
import MDom form "manipulated-dom";
const $box = new MDom(".box");
const $box = new MDom("#box");
const $box = MDom.create("box");
const $name = MDom.createTxt("hello");
$body.attr("hello", "world");
$body.attr({ id: "001" });
$body.attr("hello");
$body.attr("width", "10rem");
$body.attr({ height: "15rem" });
$body.attr("width");
$body.show();
$body.hide();
const $button = MDom.create("button");
$button.on("click", () => console.log("Clicked"));
$box.parent();
$box.remove();
const $container = MDom.create("div");
$box.replace($container);
$body.child([document.createElement("div")]);
$body.child([MDom.create("div"), $box]);
$body.child();
$body.html();
$body.html("<h1>Hello</h1>");
$body.txt();
$body.txt("Hello");