Skip to content

fabioricali/dohtml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.create(str) ⇒ Element | Node | null

Create DOM element

Kind: static method of dom

ParamDescription
str

html string or a single tag

dom.isValidNode(el) ⇒ Boolean

Check if is a valid Node

Kind: static method of dom

ParamType
el*

dom.render(target, els) ⇒ Element | Node | Error

Append multiple elements into target element

Kind: static method of dom

ParamType
targetElement
elsArray | Element

Changelog

You can view the changelog here

License

dohtml is open-sourced software licensed under the MIT license

Author

Fabio Ricali

About

Simple utility to create HTML element by a string

Resources

Stars

Watchers

Forks

Packages

No packages published