let deckId
function handleClick() {
fetch("https://apis.scrimba.com/deckofcards/api/deck/new/shuffle/")
.then(res => res.json())
.then(data => {
console.log(data)
deckId = data.deck_id
})
}
document.getElementById("new-deck").addEventListener("click", handleClick)
document.getElementById("draw-cards").addEventListener("click", () => {
fetch(`https://apis.scrimba.com/deckofcards/api/deck/${deckId}/draw/?count=2`)
.then(res => res.json())
.then(data => console.log(data))
})
/**
* Challenge:
*
* Display the images of the 2 cards you drew in the browser.
* Probably best to use `innerHTML` to insert a couple <img> elements
* on the page.
*/