This project is a simple Random Quote Generator built using JavaScript. It displays a random inspirational quote along with its author's name when a button is clicked. You can view the live version of this project Here.
The Random Quote Generator is designed to provide users with a source of motivation and inspiration by displaying random quotes from various authors. With each button click, a new quote and its author are displayed on the page.
To use the Random Quote Generator:
- Visit the Live Demo.
- Click the "New Quote" button to display a random quote along with its author's name.
- Enjoy the motivational and thought-provoking quotes!
The JavaScript code provided in this repository is responsible for generating and displaying random quotes on the web page. Here's a brief explanation of the key components:
- The
quote
array contains objects, each representing a quote with its associated text and author. - The
newQuote()
function generates a random index to select a quote from thequote
array and displays it on the web page. - A check is implemented to prevent showing the same quote consecutively using the
previousIndex
variable. - The
getElementById()
function is used to update the HTML elements with the generated quote text and author.
Thank you for checking out the Random Quote Generator project! If you have any questions, suggestions, or improvements, please feel free to reach out.