How to build a random quote generator with JavaScript and HTML, for absolute beginners
Sophanarith Sok
2.2K34

It would benefit readers to see a slightly updated script that accounts for the following items:

  • The page shows a quote upon initial load, only to replace it when the button is clicked.
  • The quote is properly marked up to aid in accessibility. So…a wrapping blockquote element with nested paragraph tag and cite tag.
  • When the button is clicked, it properly redirects focus back to the blockquote, again to aid users who might visit this page using a screen-reader.
  • Optionally, the tutorial lists one other user story: to be able to tweet the quote. Try implementing this functionality.