aboutsummaryrefslogtreecommitdiffstats
path: root/app/dom.js
diff options
context:
space:
mode:
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