Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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

              
                <div><form class="myForm" style="max-width:600px;margin:auto;">
    <fieldset id="customer">
        <label for="customer_name">Name </label>
        <input type="text" name="customer_name" id="customer_name" required data-memo>
        <label for="phone_number">Phone </label>
        <input type="tel" name="phone_number" id="phone_number" data-memo>
        <label for="email_address">Email </label>
        <input type="email" name="email_address" id="email_address" data-memo>
    </fieldset>
    <fieldset id="taxi">
        <legend>Which taxi do you require?</legend>
        <label> <input type="radio" name="taxi" id="taxi_car" required value="car" data-memo> Car </label>
        <label> <input type="radio" name="taxi" id="taxi_van" required value="van" data-memo> Van </label>
        <label> <input type="radio" name="taxi" id="taxi_tuk" required value="tuktuk" data-memo> Tuk Tuk </label>
    </fieldset>
    <fieldset id="extras">
        <legend>Extras</legend>
        <label> <input type="checkbox" name="extras" id="extras_baby" value="baby" data-memo> Baby Seat </label>
        <label> <input type="checkbox" name="extras" id="extras_wheel" value="wheelchair" data-memo> Wheelchair Access </label>
        <label> <input type="checkbox" name="extras" id="extras_tip" value="tip" data-memo> Stock Tip </label>
    </fieldset>
    <fieldset id="pickup">
        <label for="pickup_time">Pickup Date/Time</label>
        <input type="date" id="pickup_time" required data-memo>
        <label for="pickup_place">Pickup Place</label>
        <select name="pickup_place" id="pickup_place" data-memo>
            <option value="" selected="selected">Select One</option>
            <option value="office">Taxi Office</option>
            <option value="town_hall">Town Hall</option>
            <option value="telepathy">We'll Guess!</option>
        </select>
    </fieldset>
    <fieldset id="dropoff">
        <label for="dropoff_place">Dropoff Place</label>
        <input type="text" name="dropoff_place" id="dropoff_place" required list="destinations" data-memo>
        <datalist id="destinations" data-memo>
            <option value="Airport">
            <option value="Train Station">
            <option value="House">
        </datalist>
    </fieldset>
    <fieldset id="instructions">
        <label for="comments">Commentss</label>
        <textarea name="comments" id="comments" maxlength="500" data-memo></textarea>
    </fieldset>

</form>
    <button onclick="memo_form.clean()">Clean</button>
</div>
              
            
!

CSS

              
                * {
    box-sizing: border-box;
  }
div{
  background: #eee;
  padding:10px;
  width:80%;
    margin:auto;
}
  .myForm {
    width:100%;
    display: grid;
    grid-template-areas: 
      "customer taxi"
      "customer extras"
      "pickup dropoff"
      "instructions instructions"
      "submit submit";
    grid-template-columns: auto auto;  
    grid-template-rows: auto auto auto auto;
    grid-gap: .8em .5em;

    padding: 0;
  }
  .myForm textarea {
    height: calc(100% - 1.5em);
    }
  button {
    background: gray;
    color: white;
    padding: 1em;
    }
  .myForm input:not([type=radio]):not([type=checkbox]), 
  .myForm textarea, 
  .myForm select {
    width: 100%;
    border: 0;
    padding: 1em;
    margin: .5em 0;
  }
  .myForm label {
   display: block; 
  }
  fieldset {
    border: 0;
  }
  #customer {
    grid-area: customer;
  }
  #taxi {
    grid-area: taxi;
  }
  #extras {
    grid-area: extras;
  }
  #pickup {
    grid-area: pickup;
  }
  #dropoff {
    grid-area: dropoff;
  }
  #instructions {
    grid-area: instructions;
  }

              
            
!

JS

              
                memo_form = (function() {
    document.addEventListener("DOMContentLoaded", function() { load() });
    window.addEventListener('beforeunload', function() { save() });
    function save() {
        var memo = { fields: {}, clicks: [] };
        document.querySelectorAll("[data-memo]:not([type='checkbox']):not([type='radio'])").forEach(function(item) {
            memo.fields[item.id] = item.value;
        });
        document.querySelectorAll("[data-memo][type='checkbox']:checked,[data-memo][type='radio']:checked").forEach(function(item) {
            memo.clicks.push(item.id)
        });
        localStorage.setItem("memo", JSON.stringify(memo));
    }
    function load(f) {
        var memo = JSON.parse(localStorage.getItem("memo"));
        for (x in memo.fields) {
            document.getElementById(x).value = (f ? "" : memo.fields[x])
        }
        for (x in memo.clicks) {
            document.getElementById(memo.clicks[x]).checked = f ? false : true;
        }
    }
    return {
        clean: function() { load(1) }
    }
}());
              
            
!
999px

Console