Unsplash Setup
Next, let's go ahead and set up our HTML file, and get our JS file started.
File Structure
We will be working with the following files:
HTML File
Let's start with our HTML file. Make your index.html
look like the below code:
JavaScript
Now let's start our random-photo-fetch.js
file. We'll start with document.querySelector()
just like in the Star Wars API JS file. This is grabbing our .random-image
img tag and saving it to the variable randomImage
.
Next, we'll dive into working with our API and fetch!
Last updated