Files

8 lines
288 B
JavaScript

// Creates an element with an optional class name and text content.
export function el(tag, className, text) {
const element = document.createElement(tag);
if (className) element.className = className;
if (text !== undefined) element.textContent = text;
return element;
}