https://github.com/hexlet-components/js-html-tags
https://github.com/hexlet-components/js-html-tags
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hexlet-components/js-html-tags
- Owner: hexlet-components
- Created: 2016-06-05T17:54:06.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2025-07-11T20:13:19.000Z (12 months ago)
- Last Synced: 2025-09-17T22:33:01.619Z (10 months ago)
- Language: JavaScript
- Size: 2.34 MB
- Stars: 0
- Watchers: 8
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# js-html-tags
[](https://github.com/hexlet-components/js-html-tags/actions)
## Install
```sh
npm install @hexlet/html-tags
```
## Usage example
```javascript
import {
node, addChild, make, append, toString, hasChildren,
} from '@hexlet/html-tags';
const p = node('p', 'paragraph');
const ul = node('ul');
const ul2 = addChild(ul, node('li', 'body'));
const ul3 = addChild(ul2, node('li', 'another body'));
const dom1 = make();
const dom2 = append(dom1, p);
const dom3 = append(dom2, ul3);
toString(dom3);
// '
paragraph
- body
- another body
getName(p); // 'p'
getValue(p); // 'paragraph'
hasChildren(p); // false
```
For more information, see the [Full Documentation](https://github.com/hexlet-components/js-html-tags/tree/master/docs)
---
[](https://hexlet.io?utm_source=github&utm_medium=link&utm_campaign=js-html-tags)
This repository is created and maintained by the team and the community of Hexlet, an educational project. [Read more about Hexlet](https://hexlet.io?utm_source=github&utm_medium=link&utm_campaign=js-html-tags).
See most active contributors on [hexlet-friends](https://friends.hexlet.io/).