bitburner-src/utils/uiHelpers/clearSelector.ts
2021-09-04 19:09:30 -04:00

10 lines
261 B
TypeScript

/**
* Clears all <option> elements from a <select>.
* @param selector The <select> element
*/
export function clearSelector(selector: HTMLSelectElement): void {
for (let i: number = selector.options.length - 1; i >= 0; i--) {
selector.remove(i);
}
}