File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,13 @@ inputBox.onkeyup = (e)=>{
1818 linkTag . click ( ) ;
1919 }
2020 emptyArray = languages . filter ( ( data ) => {
21- //filtering array value and user characters to lowercase and return only those words which are start with user enetered chars
21+ //filtering array value and user characters to lowercase and return only those words which are start with user entered chars
2222 return data [ 2 ] . toLocaleLowerCase ( ) . startsWith ( userData . toLocaleLowerCase ( ) ) ;
2323 } ) ;
2424 // Uniq the list
2525 emptyArray = emptyArray . map ( ( data ) => {
2626 // passing return data inside li tag
27- return data = '<li>' + data [ 2 ] + '</li>' ;
27+ return data = '<li data-value="' + data [ 1 ] + '" >'+ data [ 2 ] + '</li>' ;
2828 } ) ;
2929 searchWrapper . classList . add ( "active" ) ; //show autocomplete box
3030 showSuggestions ( emptyArray ) ;
@@ -41,6 +41,8 @@ inputBox.onkeyup = (e)=>{
4141function select ( element ) {
4242 let selectData = element . textContent ;
4343 inputBox . value = selectData ;
44+ var lang = inputBox . getAttribute ( 'data-value' )
45+ console . log ( 'select() ' + selectData + ' / ' + lang ) ;
4446 icon . onclick = ( ) => {
4547 webLink = "http://demo.omnilingo.xyz/" + selectData ;
4648 linkTag . setAttribute ( "href" , webLink ) ;
You can’t perform that action at this time.
0 commit comments