mirror of
https://github.com/multipleofnpm/qthtml.git
synced 2026-01-14 00:27:57 +00:00
Bump version to 0.3.0 and add ontop method to $. Improve code consistency in index.js.
This commit is contained in:
7
index.js
7
index.js
@@ -1,10 +1,11 @@
|
||||
export const $ = (selector) =>
|
||||
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;
|
||||
};
|
||||
|
||||
export const $$ = (selector) => return document.querySelectorAll(selector)
|
||||
export const _ = msg => console.log(msg); // _('hello')
|
||||
const $$ = (selector) => { return document.querySelectorAll(selector)}
|
||||
const _ = msg => console.log(msg); // _('hello')
|
||||
|
||||
Reference in New Issue
Block a user