Document manupulation using vanila javascript
npm install dom-manupuDocument manupulation using vanila javascript
Install DOM Manupu to your project.
``bash`
pnpm install dom-manupu
Import statement DOM Manupu
`ts`
import DOM form "dom-manupu";
#### Select A Element Using Class
`ts`
const $box = new DOM(".box");
#### Select A Element Using Id
`ts`
const $box = new DOM("#box");
#### Create Element
`ts`
const $box = DOM.create("box");
#### Create Text
`ts`
const $name = DOM.createTxt("hello");
#### Set Attribute
`ts`
$body.attr("hello", "world");
#### Set Multiple Attributes
`ts`
$body.attr({ id: "001" });
#### Get Attribute Value
`ts`
$body.attr("hello");
#### Set Style
`ts`
$body.attr("width", "10rem");
#### Set Multiple Styles
`ts`
$body.attr({ height: "15rem" });
#### Get Style Value
`ts`
$body.attr("width");
`ts`
$body.show();
`ts`
$body.hide();
`ts`
const $button = DOM.create("button");
$button.on("click", () => console.log("Clicked"));
`ts`
$box.parent();
`ts`
$box.remove();
`ts`
const $container = DOM.create("div");
$box.replace($container);
#### Add A Children
`ts`
$body.child([document.createElement("div")]);
#### Add Multipe Childrens
`ts`
$body.child([DOM.create("div"), $box]);
#### Get Childrens
`ts`
$body.child();
#### Get HTML
`ts`
$body.html();
#### Set HTML
`ts`
$body.html("Hello
");
#### Get Text
`ts`
$body.txt();
#### Set Text
`ts``
$body.txt("Hello");