aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/element.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/element.ts b/src/element.ts
index 6f2a28d..7a492b3 100644
--- a/src/element.ts
+++ b/src/element.ts
@@ -20,6 +20,7 @@ interface Opts<E> {
onmouseenter?: (e: E) => void,
onmouseleave?: (e: E) => void,
onchange?: (e: E) => void,
+ aria_label?: string,
}
function apply_opts<E extends HTMLElement>(e: E, o: Opts<E>): (() => void) | void {
@@ -37,6 +38,7 @@ function apply_opts<E extends HTMLElement>(e: E, o: Opts<E>): (() => void) | voi
if (typeof o?.class == "string") e.classList.add(o.class)
if (typeof o?.class == "object") e.classList.add(...o.class)
if (o.style) for (const k in o.style) { const v = o.style[k]; if (v !== undefined) e.style[k] = v }
+ if (o.aria_label) e.ariaLabel = o.aria_label
}
type EEl<K extends keyof HTMLElementTagNameMap> = string