feat: added prependMany function

This commit is contained in:
ThinLiquid 2024-01-18 11:04:43 +00:00
parent 2dd5b5f887
commit acdba11691
No known key found for this signature in database
GPG key ID: 17538DC3DF6A7387

View file

@ -226,6 +226,18 @@ export default class HTML {
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.
* @returns HTML