Skip to content

Commit f2f069e

Browse files
committed
Refactor displayNewQuote function to use getElementById for improved performance
1 parent 4967200 commit f2f069e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎Sprint-3/quote-generator/quotes.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,8 @@ const quotes = [
494494

495495
// Function to select a random quote and update the HTML elements
496496
function displayNewQuote() {
497-
const quoteP = document.querySelector("#quote");
498-
const authorP = document.querySelector("#author");
497+
const quoteP = document.getElementById("quote");
498+
const authorP = document.getElementById("author");
499499

500500
// Get a random quote object from the quotes array
501501
const randomQuote = pickFromArray(quotes);

0 commit comments

Comments
 (0)