GithubHelp home page GithubHelp logo

randomquote's Introduction

RANDOM-QUOTE-GENERATOR

An app that displays random famous quotes every time a button is pressed in this project. A quote from a prominent athlete, politician, or historical figure is displayed:

To finish this project, I needed fundamental JavaScript syntax, such as variables, loops, and object literals.

DESCRIPTION

For the implementation of javascript and how they three-run and complement one other, I constructed a basic web application utilising JavaScript, CSS, and HTML. I created a random quote generator that shows the user a different quotation every time they touch a button. It comprises of an HTML file that will serve as the project's foundation, similar to a skeleton that will store all of the meat (content). After that, I linked the JavaScript file to the HTML content so that the JavaScript code could interact with it. We'll have numerous quotes, and each one will be chosen at random, therefore storing multiple strings in an array is the best option.to retrieve a random quote from an array it must produce a random number every time the user clicks on the button. I placed multiple quotes in an array separated by comma defined a variable called “quotes” and set it equal to an array full of the quotes that I’ve chosen. A math function will generate a random decimal number and multiply it by a whole number.

Project Specifications

Make an object array quotations is an array of items. There are at least 5 quotation items in the array. Object Quote Quote and source properties are among the array's objects. Citation and date characteristics are present if they are known. function getRandomQuote getRandomQuote is a function that returns a random object from the quotations array. function printQuote The randomQuote function is called by the printQuote function. The quote is printed on the page using the template provided in the project instructions. Comments about the code are included in the code.

SUMMARY

This project allowed me to learn more about javascript, and I was able to construct a completely functional Random Quote Generator as a result. Using HTML, CSS, and JavaScript, I created a Random Quote Generator from the ground up. I learned how to synchronise HTML, CSS, and Java. In javascript, I learned about variables, arrays, math functions, and other concepts. Recognizing the presence of classes and IDs, as well as referencing them in JavaScript code to create interactive webpages. In contrast to static web pages that do not respond to user requests, this allowed the page to change slightly or completely when a user makes an action.It detected a click on the quote button so that we can fetch a new random quote and display it to the user.

this is jatin Dhiman

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.