mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-23 14:42:28 +01:00
17 lines
348 B
TypeScript
17 lines
348 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;
|
|
}
|