Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design2
/
2017110273
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2021-04-13 18:47:13 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
25ce3fa50ded9ce59b60ca55dd00b3025fd74033
25ce3fa5
1 parent
317ef614
Delete main.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
27 deletions
src/main/resources/static/js/main.js
src/main/resources/static/js/main.js
deleted
100644 → 0
View file @
317ef61
const
countries
=
[
{
name
:
'USA'
},
{
name
:
'India'
},
{
name
:
'Argentina'
},
{
name
:
'Armenia'
},
{
name
:
"korea"
},
{
name
:
"lorem ipsum test filter"
}
];
const
searchInput
=
document
.
querySelector
(
'.search-input'
);
const
suggestionsPanel
=
document
.
querySelector
(
'.suggestions'
);
searchInput
.
addEventListener
(
'keyup'
,
function
()
{
const
input
=
searchInput
.
value
;
suggestionsPanel
.
innerHTML
=
''
;
const
suggestions
=
countries
.
filter
(
function
(
country
)
{
return
country
.
name
.
toLowerCase
().
startsWith
(
input
);
});
suggestions
.
forEach
(
function
(
suggested
)
{
const
div
=
document
.
createElement
(
'div'
);
div
.
innerHTML
=
suggested
.
name
;
suggestionsPanel
.
appendChild
(
div
);
});
if
(
input
===
''
)
{
suggestionsPanel
.
innerHTML
=
''
;
}
})
\ No newline at end of file
Please
register
or
login
to post a comment