An open API service indexing awesome lists of open source software.

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

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!

}});
````