bitburner-src/utils/uiHelpers/createOptionElement.ts

12 lines
357 B
TypeScript
Raw Normal View History

2019-01-10 09:20:04 +01:00
import { createElement } from "./createElement";
export function createOptionElement(text: string, value: string=""): 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
}