File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 33 < head >
44 < meta charset ="UTF-8 " />
55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6- < title > Title here </ title >
6+ < title > Quote generator app </ title >
77 < link rel ="stylesheet " href ="style.css ">
88 < script defer src ="quotes.js "> </ script >
99 </ head >
1717 </ section >
1818 </ body >
1919</ html >
20-
21-
Original file line number Diff line number Diff line change @@ -489,8 +489,7 @@ const quotes = [
489489 author : "Zig Ziglar" ,
490490 } ,
491491] ;
492- const title = document . querySelector ( "title" )
493- title . textContent = "Quote generator app" ;
492+
494493// call pickFromArray with the quotes array to check you get a random quote
495494const quoteEl = document . querySelector ( "#quote" ) ;
496495const authorEl = document . querySelector ( "#author" ) ;
@@ -504,7 +503,10 @@ function displayQuote() {
504503}
505504
506505// Show initial quote on page load
507- displayQuote ( ) ;
506+ function setup ( ) {
507+ displayQuote ( ) ;
508508
509- // Change quote when button is clicked
510- button . addEventListener ( "click" , displayQuote ) ;
509+ // Change quote when button is clicked
510+ button . addEventListener ( "click" , displayQuote ) ;
511+ }
512+ window . addEventListener ( "load" , setup )
You can’t perform that action at this time.
0 commit comments