dohtml
v0.1.0
Published
Simple utility to create HTML element by a string
Downloads
1,393
Readme
dohtml
Simple utility to create HTML element by a string
Installation
Node.js
npm install dohtml --save
Example
const dom = require('dohtml');
const myElement = dom.create('<my-component></my-component>');
console.log(myElement);
API
dom : Object
dohtml
Kind: global variable
- dom : Object
- .create(str) ⇒ Element | Node | null
- .isValidNode(el) ⇒ Boolean
- .render(target, els) ⇒ Element | Node | Error
dom.create(str) ⇒ Element | Node | null
Create DOM element
Kind: static method of dom
dom.isValidNode(el) ⇒ Boolean
Check if is a valid Node
Kind: static method of dom
dom.render(target, els) ⇒ Element | Node | Error
Append multiple elements into target element
Kind: static method of dom
Changelog
You can view the changelog here
License
dohtml is open-sourced software licensed under the MIT license
Author
Fabio Ricali