mirror of
https://github.com/multipleofnpm/qthtml.git
synced 2026-01-13 16:17:56 +00:00
12 lines
394 B
JavaScript
12 lines
394 B
JavaScript
const $ = (selector) =>
|
|
{
|
|
const el = document.querySelector(selector)
|
|
el.render = (html) => el.innerHTML = html
|
|
el.inject = (html) => el.insertAdjacentHTML('beforeend', html)
|
|
el.ontop = (html) => el.insertAdjacentHTML('beforebegin', html)
|
|
return el;
|
|
};
|
|
|
|
const $$ = (selector) => { return document.querySelectorAll(selector)}
|
|
const _ = msg => console.log(msg); // _('hello')
|