https://github.com/maelswarm/xelem
Make HTML elements more easily in JS
https://github.com/maelswarm/xelem
html html-element htmlelement javascript js
Last synced: 3 months ago
JSON representation
Make HTML elements more easily in JS
- Host: GitHub
- URL: https://github.com/maelswarm/xelem
- Owner: maelswarm
- License: mit
- Created: 2018-05-04T00:52:44.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-05T15:56:35.000Z (about 8 years ago)
- Last Synced: 2025-07-07T05:06:21.115Z (about 1 year ago)
- Topics: html, html-element, htmlelement, javascript, js
- Language: JavaScript
- Size: 10.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xelem
Make HTML elements more easily in JS
Would you rather do this...
````js
let myClass = 'hello';
let elem = document.createElement('div');
elem.setAttribute('class', myClass);
elem.setAttribute('id', 'world');
elem.innerHTML = 'Hello World!';
document.querySelector('.st0').appendChild(elem);
````
Or this?
````js
let myClass = 'hello';
document.querySelector('.st0').appendChild({{
Hello World!
}});
````