Ultra-light JS DOM manipulation library
npm i sypent
And include the library.
sypent is awesome because it's simple and so useful.
It's also very lightweight. Like <0.5K unminified lightweight.
Let's create a
div with class 'message' with a text node child.
let addDiv =
Now let's create a
p tag with text nested inside of a div.
let complex =
attributes, ?Array[HTMLElement | String | DocumentFragment]
tagName - Tag of generated element.
attributes - Attributes for generated element. Default:
children - Children (elements) of generated element. May also contain strings, which will be made into text nodes. Default: