Exercise : Get object data and dynamically create web page elements with code
- Select the page elements, and create a variable for the URL path to connect to.
- Using the btn onclick event, connect to the API with fetch.
- Once data is retrieved, output the array of items into the web page. Create a separate function to handle the element creation and adding to the page.
- Loop through all the items in the data, using document.createElement() create page elements, append them to the element with the class of output.