mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 17:53:55 +01:00
16 lines
479 B
TypeScript
16 lines
479 B
TypeScript
import { getElementById } from "./getElementById";
|
|
import { removeElement } from "./removeElement";
|
|
|
|
/**
|
|
* Given its id, this function removes an element AND its children
|
|
* @param id The HTML identifier to search for and remove.
|
|
*/
|
|
export function removeElementById(id: string): void {
|
|
try {
|
|
const elem: HTMLElement = getElementById(id);
|
|
removeElement(elem);
|
|
} catch (e) {
|
|
// Probably should log this as we're trying to remove elements that don't exist.
|
|
}
|
|
}
|