aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/getIndexFromSelect.ts
diff options
context:
space:
mode:
authorstonedDiscord <stonedDiscord@users.noreply.github.com>2024-11-20 13:31:50 +0000
committerGitHub Action <actions@github.com>2024-11-20 13:31:50 +0000
commit6684f3fce6e90fd0574d7bab63b629554ab03ef6 (patch)
treeb2a62247d17e23a77af57aea355ba621666817c2 /webAO/dom/getIndexFromSelect.ts
parent95a2d1361d84c61b454ebe506e6963b93f6d8dee (diff)
Prettified Code!
Diffstat (limited to 'webAO/dom/getIndexFromSelect.ts')
-rw-r--r--webAO/dom/getIndexFromSelect.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/webAO/dom/getIndexFromSelect.ts b/webAO/dom/getIndexFromSelect.ts
index 2f21653..dbbdd2b 100644
--- a/webAO/dom/getIndexFromSelect.ts
+++ b/webAO/dom/getIndexFromSelect.ts
@@ -4,13 +4,13 @@
* @param {string} value the value that need to be compared
*/
export function getIndexFromSelect(select_box: string, value: string) {
- // Find if icon alraedy existed in select box
- const select_element = <HTMLSelectElement>document.getElementById(select_box);
- for (let i = 1; i < select_element.length; ++i) {
- if (select_element.options[i].value === value) {
- return i;
- }
+ // Find if icon alraedy existed in select box
+ const select_element = <HTMLSelectElement>document.getElementById(select_box);
+ for (let i = 1; i < select_element.length; ++i) {
+ if (select_element.options[i].value === value) {
+ return i;
}
- return 0;
+ }
+ return 0;
}
-window.getIndexFromSelect = getIndexFromSelect; \ No newline at end of file
+window.getIndexFromSelect = getIndexFromSelect;