
const quote = document.querySelector("#quote span:first-child");
const author = document.querySelector("#quote span:last-child");
const todaysQuote = quotes[Math.floor(Math.random()*quotes.length)];
quote.innerText = todaysQuote.quote;
author.innerText =todaysQuote.author;
html
<div id="quote">
<span></span>
<span></span>
</div>
const chosenImage = images[Math.floor(Math.random()*images.length)];
const bgImage = document.createElement("img");
// JS에 html element 생성
bgImage.src=`img/${chosenImage}`;
//body에 html 추가 prepend는 가장 위에 오게
document.body.appendChild(bgImage);