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