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; -}