Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <html lang="en">
  <meta charset="utf-8">

  <title>Github Elm Demo</title>
  <meta name="description" content="Interact with the Github API using Elm.">
  <meta name="author" content="Muyiwa Olu-Ogunleye">

  <link rel="stylesheet" href=""/>
  <link rel="stylesheet" href="css/style.css?v=1.0"/>

  <!--[if lt IE 9]>
    <script src=""></script>

  <div class="container helvetica">
    <div class="title">
      <h1>Github Elm Demo</h1>
      <div class="subtitle">
        <h3>Interacting with the Github API using Elm.</h3>
    <div id="app">
      <input type="text" placeholder="Username" id="usernameTextBox">
      <button id="gatherDataButton">Gather Data</button>
      <div id="result"></div>





                let usernameTextBox = document.getElementById('usernameTextBox');

const gatherDataButton = document.getElementById('gatherDataButton');
const resultDiv = document.getElementById('result');

const updateButtonDisplay = () => {
  if (! usernameTextBox.length) { = 'none';
  } else { = '';

const updateUsernameAndButtonDisplay = (event) => {
  usernameTextBox =;

const pickUsername = (data) => {
  message = '';

  if( {
    message = `Username is ${}`;
  } else if (data.login) {
    message = `Username unavailable, login is ${data.login}`;
  } else {
    message = 'Username and login unavailable :(';

  return message;

const fetchUsername = (username) => {
  fetch(`${username}`).then(function(response) {
    if (!response.ok) {
      throw Error(response.statusText);
    return response.json();
  }).then(function(data) {
    result.textContent = pickUsername(data);
  }).catch(function(err) {
    result.textContent = err.message;

const fetchData = () => {

const initialiseDOM = (_event) => {
  gatherDataButton.addEventListener("click", fetchData);
  usernameTextBox.addEventListener("input", updateUsernameAndButtonDisplay);

document.addEventListener("DOMContentLoaded", initialiseDOM);