[Solved] My quotes are not printing


Errors are here:

    quoteOne = {
        quote : 'I meant what I said and I said what I meant.',
        source : 'Dr. Seuss',
        citation : 'dont know',
        year : '1990'
    }
        quoteTwo = {
        quote : 'Truth is everybody is going to hurt you: you just gotta find the     ones worth suffering for.',
        source : 'Bob Marley',
        citation : 'Smoke session',
        year : '1989'
    }
        quoteThree = {
        quote : 'Never interrupt your enemy when he is making a mistake.',
        source : 'Napoleon Bonaparte',
        citation : 'I dont know',
        year : 'N/a'
    }
        quoteFour = {
        quote : 'Fear is the main source of superstition, and one of the main sources of cruelty. To conquer fear is the beginning of wisdom.',
        source : 'Bertrand Russell',
        citation : 'I dont know',
        year : 'N/a'
    }
    quoteFive = {
        quote : 'Curiosity will conquer fear even more than bravery will.',
        source : 'James Stephens',
        citation : 'I dont know',
        year : 'some year'
    }
    var quotes = [quoteOne, quoteTwo, quoteThree, quoteFour,quoteFive];

    function getRandomQuote() {
        var item = quotes[Math.floor(Math.random()* quotes.length)];
        return '<strong class="lead" style="color:#00000;">' + item.quote + '</strong> - (<a target="_blank" href="' + item.source + '">url</a>)<hr style="margin:0;"><p style="margin-bottom:0;">' + item.citation + '<br>' + item.year + ', ' ;
    }
    function printQuote() {
        document.getElementById('quote-box').innerHTML = getRandomQuote();
    }

    console.log(printQuote());
<div id="quote-box"></div>
  • You get a single document using quotes[randomNumber], so no need to loop,
  • You didn’t set the innerHTML to the getRandomQuote() value in printQuote(),
  • There was no return value from getRandomQuote().

2

solved My quotes are not printing