In this task, we will use JavaScript to create a simple web page that generates random quotes. The user can click a button to generate a new quote, which will be displayed on the page.
-
Add event listener to
new-quote-button. -
Create an array of at least 5 quotes, each quote should be a
string. -
Use the random number to select a quote from the quotes array.
-
Create a
divcontainer with theidofquote-container. -
Append the
quote-containerto thequote-listelement. -
Create a new
pelement and add theidproperty ofquote-textto it. -
Set the text content of the
quote-textelement to the selected quote. -
Append the new
quote-textto thequote-container. -
Test your page to make sure the button generates a new quote each time it is clicked.
