bitburner-src/utils/uiHelpers/createOptionElement.ts

12 lines
349 B
TypeScript
Raw Normal View History

2019-01-10 09:20:04 +01:00
import { createElement } from "./createElement";
2021-04-30 05:52:56 +02:00
export function createOptionElement(text: string, value=""): HTMLOptionElement {
let sanitizedValue: string = value;
2019-01-10 09:20:04 +01:00
if (sanitizedValue === "") { sanitizedValue = text; }
return createElement("option", {
text: text,
value: sanitizedValue,
}) as HTMLOptionElement;
2019-01-10 09:20:04 +01:00
}