Skip to content

Commit 0f299c7

Browse files
author
Simon he
committed
chore: add createElement
1 parent e4a1b0c commit 0f299c7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/createElement.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export function createElement(tag: string, attributes: Record<string, string>) {
2+
const el = document.createElement(tag)
3+
for (const key in attributes)
4+
el.setAttribute(key, attributes[key])
5+
6+
return el
7+
}

0 commit comments

Comments
 (0)