Move getQuote() call to the end of the script

This commit is contained in:
Andrea Fazzi 2024-08-05 18:54:55 +02:00
parent bbc7cd5966
commit 227287c624

View file

@ -1,8 +1,6 @@
let blockquote = document.querySelector('blockquote');
let button = document.querySelector('button#get-quote');
getQuote();
function getQuote () {
blockquote.textContent = 'Getting a fresh quote...';
@ -24,6 +22,8 @@ button.addEventListener('click', function (event) {
getQuote();
});
getQuote();