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