Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Somespi/tagdom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

45 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

TagDOM

convert HTML-like tags into native DOM elements with TagDOM.

Installation

You can install TagDOM using npm:

npm install tagdom

Sample Usage

you can easily use TagDOM with this minimal syntax:

import {tag} from 'tagdom';

const myelement = tag`<h1 {style="color:red;"}>Hello, World!</h1>`;
document.body.appendChild(myelement);

๐Ÿ“– Note

TagDOM can be Whitespace-sensitive sometimes. , for example:

// This may not work โŒ
const myelement = tag`<h1 {style="color:red;"} >Hello, World!</h1>`;

// you need to remove any whitespace between "}" and ">"
// This may work โœ…
const myelement = tag`<h1 {style="color:red;"}>Hello, World!</h1>`;

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published