<h1 class="text">JavaScript setTimeout() Example 3</h1>
<p class="text"><strong>Britney: </strong>What did you have for lunch today?</p>
<p class="text" id="ashley"></p>
.text {
text-align: center;
}
const ashley = document.getElementById("ashley");
function lunchMenu(food1, food2) {
ashley.innerHTML = `<strong>Ashley: </strong>I had ${food1} and ${food2}.`;
}
setTimeout(lunchMenu, 3000, "pizza", "salad");
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.