Bump version to 0.3.0 and add ontop method to $. Improve code consistency in index.js.

This commit is contained in:
sss
2025-06-05 15:24:29 -07:00
parent 70698d20cd
commit cf3aaca28a
3 changed files with 6 additions and 5 deletions

View File

@@ -2,12 +2,12 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="index.js"></script>
</head>
<body>
<h1>Testing index.js Module Import</h1>
<script type="module">
import {$} from './index.js'
$('body').render(`new`)
</script>

View File

@@ -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')

View File

@@ -1,6 +1,6 @@
{
"name": "qthtml",
"version": "0.2.0",
"version": "0.3.0",
"description": "",
"main": "index.js",
"type": "module",