0.0.3 • Published 4 years ago
etranstring v0.0.3
Etranstring
This library is designed to convert HTML strings to HTML code.
Installation
npm i etranstring --save-dev
Connection and Example
import Etranstring from 'etranstring';
const wrapper = new Etranstring('<div class="wrapper main-wrapper"></div>').getRes();
const title = new Etranstring('<h1 class="title">Title</h1>').getRes();
wrapper.appendChild(title);
document.body.appendChild(wrapper);
Basic concepts and conditions
Condition | Example |
---|---|
Write attributes through the symbol: "==" | <input type="text"==class="input"==placeholder="Enter your name"> |
In the "style" attribute, specify properties strictly through the symbol: ";" with a space | <span style="color: green; font-size: 14px"></span> |
Important
Doesn't support nested tags.
Do not write the following characters in the tag content: >,<,"",’’,