bitburner-src/utils/uiHelpers/createOptionElement.ts
2021-09-08 23:47:34 -04:00

14 lines
341 B
TypeScript

import { createElement } from "./createElement";
export function createOptionElement(text: string, value = ""): HTMLOptionElement {
let sanitizedValue: string = value;
if (sanitizedValue === "") {
sanitizedValue = text;
}
return createElement("option", {
text: text,
value: sanitizedValue,
}) as HTMLOptionElement;
}