Making search bar: How to make results "disappear" when you hit a backspace?

Hello! I’m making a search bar: https://warn-notices.glitch.me/

Unfortunately, I can’t seem to figure out how to make the results go away when you delete your search bar entry. Any ideas what we may be missing?

@nisakhan Try changing:

if(searchValue != ""){}

to

if(searchValue != null){}

or

if(searchValue != undefined){}

May fix it, may not. Let me know the results :slight_smile:

1 Like

if(!searchValue){}

3 Likes

Or try if (typeof searchValue !== undefined). Try all of these combinations, one of them might work. :wink:

1 Like

Hi all!

It worked!

Thank you so much for your help and quick responses! I really appreciate it. (Let me know if I should thank you on Glitch too, since not sure how to do that offline!)

2 Likes

So people can find the solution to your problem and to see your own has been fixed, please mark my post as a solution by clicking the button under it :slight_smile:
Have a nice day
Eddie

2 Likes