A lightweight HTML element builder
import * as lw from "lightwrite";
// or as String:
lw.as.string(
lw("div").class("greeting")(lw("p").class("greeting-text")("hello!"))
);
//"<div class="greeting"><p class="greeting-text">hello!</p></div>"
// or as Element:
lw.as.element(
lw("div").class("greeting")(lw("p").class("greeting-text")("hello!"))
);
//<div class="greeting"><p class="greeting-text">hello!</p></div>
This will initialize a new LWElement
This can write the pure text instead of the html
This can write the html instead of the text (default, when passing in strings)
This will convert the LWElement to a string or a HTMLElement
This will convert the LWElement to a string
This will convert the LWElement to a HTMLElement
This will set the attribute [ key ] to value
This will add multiple elements as a child.
This will add multiple elements as a child.