bitburner-src/utils/uiHelpers/clearSelector.ts

10 lines
261 B
TypeScript
Raw Normal View History

/**
* Clears all <option> elements from a <select>.
* @param selector The <select> element
*/
2021-05-01 09:17:31 +02:00
export function clearSelector(selector: HTMLSelectElement): void {
2021-09-05 01:09:30 +02:00
for (let i: number = selector.options.length - 1; i >= 0; i--) {
selector.remove(i);
}
}