()
| 182 | //Function to call the getRandomQuote function and stores the returned quote object in a variable |
| 183 | //Constructs a string containing the different properties of the quote object |
| 184 | function printQuote () { |
| 185 | var quotes = getRandomQuote (); |
| 186 | var quoteContainer = document.getElementById("quote-box"); |
| 187 | var quoteString = `<p class="quote">${quotes.quote}</p><p class="source">${quotes.source}`; |
| 188 | if (quotes.citation) {quoteString += `<span class="citation">${quotes.citation}</span>`} |
| 189 | if (quotes.year) {quoteString += `<span class="year">${quotes.year}</span></p>`} |
| 190 | else {quoteString += '</p>'}; |
| 191 | quoteContainer.innerHTML = quoteString; |
| 192 | |
| 193 | //assigns random color value to document background color |
| 194 | document.body.style.backgroundColor = getRandomColor (); |
| 195 | } |
| 196 | |
| 197 | //Quote automatically refreshes every 15 seconds |
| 198 | window.setInterval(function(){ |
no test coverage detected