From 1e47864ee2890eb86c1269671c52eb2e6f912a26 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 15 Dec 2022 12:02:53 +0100 Subject: [PATCH] Remove obsolete files --- src/js/elt.js | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 src/js/elt.js diff --git a/src/js/elt.js b/src/js/elt.js deleted file mode 100644 index 5a01162..0000000 --- a/src/js/elt.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Creates a new element based on the provided data. - * - * @param {string} type - * The type of the element to create. - * - * @param {Record} attrs - * The attributes to add. - * - * @param {...(Node | string)} children - * The children to add to the element. - * - * @returns {HTMLElement} - * The newly created element. - */ -export function elt(type, attrs, ...children) -{ - let node = document.createElement(type); - - Object.keys(attrs).forEach( - key => - { - node.setAttribute(key, attrs[key]); - }); - - for (let child of children) - { - if (typeof child !== "string") - { - node.appendChild(child); - } - else - { - node.appendChild(document.createTextNode(child)); - } - } - - return node; -}