Skip to content

Commit

Permalink
Update JSDoc and simplify createElementWithClasses
Browse files Browse the repository at this point in the history
  • Loading branch information
nachtjasmin committed Sep 12, 2023
1 parent 4489602 commit d59b170
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/libs/hovercard/hovercard_helpers.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
/**
* Creates a new HTML elmenent of the given tag name and the finite amount fo classes.
* Creates a new HTML elmenent of the given tag name and the finite amount of classes.
*
* @param {string} tagname
* @param {...string} classnames
* @param {string[]} classnames
* @returns {HTMLElement}
*/
export function createElementWithClass(tagname, ...classnames) {
const el = document.createElement(tagname);
for (const classname of classnames) {
el.classList.add(classname);
}

el.classList.add(...classnames);
return el;
}

Expand Down

0 comments on commit d59b170

Please sign in to comment.