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.


                <div class="ui-input-container">
  Start typing, or copy and paste your document below...<br /><br />
  <label class="ui-form-input-container">
    <textarea class="ui-form-input" id="word-count-input"></textarea>
    <span class="form-input-label">Message</span>
  <div aria-live="polite" style="text-align: center;">
    <input type="button" value="Reset" onclick="reset();">
    <strong><span id="word-count">0</span> words</strong> | <strong><span id="character-count">0</span> characters</strong>.</div>


                * {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
.ui-input-container {
  background-color: #eeeeee;
  padding: 1rem;
  border-radius: 4px;
  width: 100%;
  margin: 0 auto;
.ui-input-container div {
  font-size: 20px;
  color: #cc0000;
  font-family: Trebuchet MS;
.ui-form-input-container {
  position: relative;
  font-size: 1rem;
  margin-bottom: 15px;
  display: block;
.ui-form-input {
  background-color: #f8f8f8;
  padding: 13px 15px;
  border: 1.2px solid #cc0000;
  outline: 0;
  width: 100%;

.form-input-label {
  position: absolute;
  top: -7px;
  left: 10px;
  color: #cc0000;
  font-size: 0.85rem;
  padding-right: 0.33rem;
  padding-left: 0.33rem;
  background: #eeeeee;
  border: 0.5px solid #cc0000;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: sans-serif;
  text-transform: capitalize;

.ui-form-btn {
  padding: 13px 15px;
  border-radius: 8px;
  background: #1a73e8;
  outline: 0;
  width: 100%;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: white;
  font-weight: 500;

.error .ui-form-input,
.error .form-input-label {
  border-color: #d50000;
  color: #d50000;

textarea {
  min-height: 12em;
  max-height: 100vh;
  width: 100%;



                var countTarget = document.querySelector("#word-count-input");
var wordCount = document.querySelector("#word-count");
var characterCount = document.querySelector("#character-count");

var count = function () {
  var characters = countTarget.value;
  var characterLength = characters.length;

  var words = characters.split(/[\n\r\s]+/g).filter(function (word) {
    return word.length > 0;

  wordCount.innerHTML = words.length;
  characterCount.innerHTML = characterLength;


  function (event) {
    if ("#word-count-input")) {

function reset() {
  var ta = document.getElementById("word-count-input");
  ta.value = ta.defaultValue;