feat: added prependMany function
This commit is contained in:
parent
2dd5b5f887
commit
acdba11691
1 changed files with 12 additions and 0 deletions
12
src/HTML.ts
12
src/HTML.ts
|
|
@ -226,6 +226,18 @@ export default class HTML {
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepend multiple elements. Typically used as a `.prependMany(new HTML(...), new HTML(...)` call.
|
||||||
|
* @param elements The elements to prepend.
|
||||||
|
* @returns HTML
|
||||||
|
*/
|
||||||
|
prependMany (...elements: any[]): HTML {
|
||||||
|
for (const elem of elements) {
|
||||||
|
this.prepend(elem)
|
||||||
|
}
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear the innerHTML of the element.
|
* Clear the innerHTML of the element.
|
||||||
* @returns HTML
|
* @returns HTML
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue