A page with fresh content
Let's combine DOM skills and fetch: a card that shows an inspiring quote, with a button for a new one. While it loads, it says "Loading…"; if something fails, it says so kindly.
Split drawing from loading
Keep two functions: showQuote(q) only draws a quote object on the page, and loadQuote() fetches one and passes it to showQuote. Drawing is then easy to test without the internet.
function showQuote(q) {
document.querySelector("#text").textContent = "“" + q.quote + "”";
document.querySelector("#author").textContent = "— " + q.author;
}
showQuote({ quote: "Little by little, a little becomes a lot.", author: "Tanzanian proverb" });