Fetch API suggestions as you type and track selected results

Develop an autocomplete search suggestion feature that dynamically displays search suggestions to users as they type in a search query. This feature fetches search results from an API endpoint and displays them as suggestions in real-time. Selected results are displayed separately, enhancing user experience and interaction. The ARIA combobox pattern describes accessible autocomplete search behavior.
The functionality is akin to what you might find in popular search engines, where suggestions appear as you type, based on the current input. This not only makes the search process more efficient but also provides users with a glimpse of what information is available even before they complete typing their query.
Input Examples:
This task involves handling user input in real-time, querying an API for search results based on this input, and then displaying these results as clickable suggestions. When a user selects a suggestion, it should be displayed separately to indicate selection.
Please use https://dummyjson.com/products/search?q=yourkeyword endpoint to fetch results
The completion of this feature involves understanding and handling asynchronous operations, DOM manipulation, and event handling in JavaScript. It is a practical and commonly implemented feature in many web applications, making it an essential skill for frontend developers.