aboutsummaryrefslogtreecommitdiffstats
path: root/app/dom.js
diff options
context:
space:
mode:
authorPetri Hienonen <petri.hienonen@gmail.com>2025-11-13 13:23:25 +0200
committerPetri Hienonen <petri.hienonen@gmail.com>2025-11-13 16:01:24 +0200
commit2113f8269423932fa76ae4f822f77a07dd703266 (patch)
tree564a92220ab89b91c17efa63fc94549a90445573 /app/dom.js
parent4372d56a51a9596b1636d133b03057b0ba84c920 (diff)
downloadhousing-2113f8269423932fa76ae4f822f77a07dd703266.tar.zst
Refactor, add light rail and tram stops
Diffstat (limited to 'app/dom.js')
-rw-r--r--app/dom.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/app/dom.js b/app/dom.js
index 508636a..4419205 100644
--- a/app/dom.js
+++ b/app/dom.js
@@ -38,7 +38,7 @@ export class Dom {
* @param {DomOptions} options
* @returns {HTMLDivElement}
*/
- static div(options) {
+ static div(options = new DomOptions()) {
const div = document.createElement("div");
Object.assign(div.style, options.styles);
if (options.id) div.id = options.id;
@@ -110,6 +110,16 @@ export class Dom {
}
/**
+ * Create a `<strong>`
+ * @param {string} text
+ */
+ static strong(text) {
+ const strong = document.createElement("strong");
+ strong.textContent = text;
+ return strong;
+ }
+
+ /**
* Create a `<label>`
* @param {string} to
* @param {string} text