2019-01-14 19:34:04 -08:00
|
|
|
export function getSelectValue(selector: HTMLSelectElement | null): string {
|
|
|
|
if (selector == null) { return ""; }
|
2019-01-20 14:57:38 -08:00
|
|
|
if (selector.options.length <= 0) { return ""; }
|
2019-01-21 20:39:52 -08:00
|
|
|
if (selector.selectedIndex < 0) { return ""; }
|
2019-01-20 14:57:38 -08:00
|
|
|
return selector.options[selector.selectedIndex].value;
|
2019-01-14 19:34:04 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function getSelectText(selector: HTMLSelectElement | null): string {
|
|
|
|
if (selector == null) { return ""; }
|
2019-01-20 14:57:38 -08:00
|
|
|
if (selector.options.length <= 0) { return ""; }
|
2019-01-21 20:39:52 -08:00
|
|
|
if (selector.selectedIndex < 0) { return ""; }
|
2019-01-20 14:57:38 -08:00
|
|
|
return selector.options[selector.selectedIndex].text;
|
2019-01-14 19:34:04 -08:00
|
|
|
}
|