bitburner-src/utils/uiHelpers/createOptionElement.ts
2019-01-14 19:34:04 -08:00

12 lines
357 B
TypeScript

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