document.getElementById("SearchBox").addEventListener("keyup", handleSearchChange); const autocompleteBox = document.getElementById("autocomplete-items"); autocompleteBox.style.display = "none"; function handleSearchChange(e) { console.log(e.target.value); return; // No you won't. I'm not done yet. // Check if known prefix is used (either > or #) if(e.target.value != "" ) { autocompleteBox.style.display = "block"; autocompleteBox.innerHTML = "Search results will show up here soon
Trust me
Results"; } else { autocompleteBox.style.display = "none"; } if (e.target.value[0] == ">") { autocompleteBox.innerHTML = "Start typing to search for commands
>goto items"; if(e.target.value == ">goto items") { autocompleteBox.innerHTML = "Goto Items"; } } else if (e.target.value[0] == "#") { // Search for SKU autocompleteBox.innerHTML = "Start typing to search for items by SKU"; } else { // Search for name } }