aboutsummaryrefslogtreecommitdiffstats
path: root/app/dom.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/dom.js')
-rw-r--r--app/dom.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/dom.js b/app/dom.js
index 8e73a09..11d2a0a 100644
--- a/app/dom.js
+++ b/app/dom.js
@@ -121,10 +121,14 @@ export class Dom {
/**
* Create a `<a>`
+ * @param {string} url
* @param {DomOptions} o
+ * @param {string|undefined} text
*/
- static a(o) {
+ static a(url, o, text) {
const link = document.createElement("a");
+ if (text) link.text = text;
+ link.href = url;
Object.assign(link.style, o.styles);
if (o.id) link.id = o.id;
for (const cls of o.classes) link.classList.add(cls);