Search the catalog for tea & honey. The ampersand belongs inside one q value, not between two parameters. URLSearchParams handles that encoding; textContent has a different job when the result reaches the page.
The form listener and async loader are supplied. Start by stopping navigation, then build and display the request URL. Finally render the returned names and an empty message. The mock reads the actual URL and filters local products.
Edit script.js, Run to inspect the preview, then Submit to check your work. The HTML, styles, offline fixture, and event/request plumbing are supplied. Functions assigned to window can also be called independently by the checks.
#catalog-form submit handler.catalogURL(term) return /api/catalog with the trimmed term encoded as a q parameter using URLSearchParams. Include q even for an empty term.showCatalogURL(url) display the URL as literal text in #request-url.renderProducts(products) replace #results with one text-only li per product name, clearing it for an empty array.showCatalogEmpty() announce No matches. in #search-status.Search a missing name, then clear the field to restore every product. The fixture makes no network request. Loading and failures return in the dashboard; this page isolates query construction.