bitburner-src/utils/uiHelpers/createOptionElement.ts
2021-04-29 23:52:56 -04:00

12 lines
349 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;
}