let's build a Book Search page Refer to the below image.
https://assets.ccbp.in/frontend/content/dynamic-webapps/book_search_output.gif
achieve functionality.
- When a value is entered in the HTML input element with id searchInput and press on Enter key
- Get title, imageLink, author (HTTP response with key search_results) by making HTTP request using fetch with URL https://apis.ccbp.in/book-store?title=kalam&maxResults=30
- Set imageLink in the HTML img element and set author in the HTML paragraph element
- When a value is entered in the HTML input element with id searchInput and an option is selected in drop down
- Make HTTP GET request to fetch books based on the title entered, maximum number of results
- If search results not equal to zero, append the search results to the HTML container element with id searchResults
- If search results equal to zero, then "No results found"
Bg img:
https://assets.ccbp.in/frontend/dynamic-webapps/book-search-bg.png
Comments
Leave a comment