Description
So far, we've shown random images and requested images for cute dog breeds on the Internet. Now, let's show sub-breeds of a specific breed.
Similar to the previous stage, when users enter a breed name, show sub-breeds using the API. You can check the documentation to see the endpoint.
Start by adding a new button with the ID button-show-sub-breed and the text Show Sub-Breed.
Use the same input tag from the previous stage to get the user's input.
The functionality part has the same constraints as before, but this time, display the data as an ordered list. Make sure to handle unknown breeds.
If there is no sub-breed for a breed, show a paragraph with the text No sub-breeds found!
You can use the IDs we've provided to select the elements.
Objectives
Your page should:
Contain a
buttonwith the idbutton-show-sub-breedand the textShow Sub-Breed;Use the DOG API;
Display the breed's sub-breeds as a list from the API;
Handle unknown input and show a paragraph with the text
Breed not found!;Handle a case when there are no sub-breeds and show a paragraph with the text
No sub-breeds found!
Examples
Example 1: after entering a breed name and clicking the button
Example 2: after entering a breed name without a sub-breed and clicking the button