js/script.js
/***
 * `printQuote` function
 This function calls the quote getter function and translates the json object
 into an html string.
***/
`printQuote` function
This function calls the quote getter function and translates the json object
into an html string.
` printQuote ` function This function calls the quote getter function and translates the json object into an html string .
function printQuote() {
  var quotejson = getRandomQuote();
  var htmlstring = `\
    <p class='quote'>${quotejson.quote}</p>\
    <p class='source'> ${quotejson.source}\
    `;
  if (quotejson.citation != "") {
    htmlstring = htmlstring + `<span class='citation'>${quotejson.citation}</span>`
  }
  if (quotejson.year != "") {
    htmlstring = htmlstring + `<span class='year'>${quotejson.year}</span>`
  }
  if (quotejson.tag) {
    htmlstring += `<p>tag: ${quotejson.tag}</p>`
  }
  htmlstring = htmlstring + "</p>"
  document.getElementById('quote-box').innerHTML = htmlstring;
  changeBackgroundColor();
  return htmlstring;
}
function printQuote ( ) { var quotejson = getRandomQuote ( ) ; var htmlstring = ` \
 ${ quotejson . quote } \
 ${ quotejson . source } \
 ` ; if ( quotejson . citation != "" ) { htmlstring = htmlstring + ` ${ quotejson . citation } ` } if ( quotejson . year != "" ) { htmlstring = htmlstring + ` ${ quotejson . year } ` } if ( quotejson . tag ) { htmlstring += ` ${ quotejson . tag } ` } htmlstring = htmlstring + "</p>" document . getElementById ( 'quote-box' ) . innerHTML = htmlstring ; changeBackgroundColor ( ) ; return htmlstring ; }
`printQuote` function
This function calls the quote getter function and translates the json object
into an html string.
` printQuote ` function This function calls the quote getter function and translates the json object into an html string .
// Get the quote // update the html