function E(tagName, attrs) {
	const el = document.createElement(tagName);
	if (attrs) {
		for (const key in attrs) {
			if (key === "class") {
				el.className = attrs[key];
			} else {
				el.setAttribute(key, attrs[key]);
			}
		}
	}
	return el;
}
@template {keyof HTMLElementTagNameMap} K
@param {K} tagName
@param {Record<string, string>} [attrs]
@returns {HTMLElementTagNameMap[K]}