Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Random quote project template from

Project Details

Write a script that gets a random quote from an API and renders it into the DOM.

Not sure what API to use? I like the Ron Swanson Quotes API.


  • What do you do if the quote API fails?
  • How do you protect yourself from XSS attacks with third-party API data?

Need help?

This project is part of the Vanilla JS Academy.

<!DOCTYPE html>
<title>Project Template</title>
<style type="text/css">
body {
margin-left: auto;
margin-right: auto;
max-width: 40em;
width: 88%;
<h1>Random Quote</h1>
<div id="quote"></div>
// Project code...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment