File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed
Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1- <!DOCTYPE html>
1+ <!doctype html>
22< html lang ="en ">
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 </ title >
77 < script defer src ="quotes.js "> </ script >
8+ < link rel ="stylesheet " href ="style.css " />
89 </ head >
910 < body >
1011 < h1 > hello there</ h1 >
Original file line number Diff line number Diff line change @@ -491,3 +491,14 @@ const quotes = [
491491] ;
492492
493493// call pickFromArray with the quotes array to check you get a random quote
494+
495+ const quoteText = document . getElementById ( "quote" ) ;
496+ const authorText = document . getElementById ( "author" ) ;
497+
498+ const newQuoteBtn = document . getElementById ( "new-quote" ) ;
499+
500+ newQuoteBtn . addEventListener ( "click" , ( ) => {
501+ const selectedQuote = pickFromArray ( quotes ) ;
502+ quoteText . textContent = selectedQuote . quote ;
503+ authorText . textContent = `-- ${ selectedQuote . author } ` ;
504+ } ) ;
Original file line number Diff line number Diff line change 11/** Write your CSS in here **/
2+ # author {
3+ font-style : italic;
4+ }
You can’t perform that action at this time.
0 commit comments