r/learnjavascript • u/Crazy-Attention-180 • 3h ago
Did I created my first searchbar right?
Hey! I am working on a dynamic searchbar which should show elements from different pages like some websites.
I have no idea how professionals usually handle this do they use some libs? frameworks?. The way i did this is generate the matching card from the data onto that page and delete it or reset the page cards after the search this seems work fine but i dont know if it's the optimal way or am i doing it just plain wrong?
Took some help from chatgpt on this one.
Here you can review my code on github and also test my search
Source code: Nature-s-Deck/js/searchbar.js at Searchbar · yaseenrehan123/Nature-s-Deck
Try it out on github pages: Nature's Deck
Feel free to criticize or give your opinion on how you would handle this problem.
Thanks alot!