side_menu/src/lib/createElement.js
Simon Vieille 7c86d53da7
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
fix issue with loader and refactoring
2022-10-16 19:57:32 +02:00

12 lines
242 B
JavaScript

module.exports = (tagName, attributes) => {
const element = document.createElement(tagName)
if (typeof attributes === 'object') {
for (let i in attributes) {
element.setAttribute(i, attributes[i])
}
}
return element
}