mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-05 19:24:39 +00:00
27 lines
539 B
TypeScript
27 lines
539 B
TypeScript
export function CreateElement(
|
|
type: string,
|
|
class_?: any,
|
|
id?: any,
|
|
innerText?: string,
|
|
innerHTML?: string,
|
|
style?: string,
|
|
) {
|
|
let element = document.createElement(type);
|
|
if (class_ !== undefined) {
|
|
element.classList.add(class_);
|
|
}
|
|
if (id !== undefined) {
|
|
element.id = id;
|
|
}
|
|
if (innerText !== undefined) {
|
|
element.innerText = innerText;
|
|
}
|
|
if (innerHTML !== undefined) {
|
|
element.innerHTML = innerHTML;
|
|
}
|
|
if (style !== undefined) {
|
|
element.style.cssText = style;
|
|
}
|
|
return element;
|
|
}
|