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 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


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.


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.


                <p>Reference for blog post <a style="font-weight: bold;" href="">Enhancing Your Javascript / Getting a Little More Structure in Your Tools</a></p>
<div class="js-message">Hello World!</div>
<div class="js-message">What a wonderful day to code, with the module pattern</div>
<input type="button" value="Update Messages" onClick="helper.messageUpdater.updateMessages()" />


                div {
  padding: 5px
input[type="button"] {
  margin: 10px;


                // Using the helper namespace for this tool.
var helper = helper || {};

 * messageUpdater tool for updating DOM messages.
 * @param {Object} $ - Selector to use within messageUpdater.
helper.messageUpdater = (function ($) {

  /** Settings which may be changed at any time. */
  var _settings = {
    selector: '.js-message',
    message: 'All your base are belong to us.'

  var _cantTouchThis = '🦀';

  /** Update DOM messages */
  var _updateMessages = function () {
    var elems = $(_settings.selector);

    console.log('Found', elems.length, 'DOM elements to update');

    for (var i = 0; i < elems.length; i++) {
      elems[i].textContent = _settings.message;

   * Returns an object with 'settings' and 'updateMessages' properties.
  return {
    settings: _settings,
    updateMessages: _updateMessages

})(jQuery); // Pass jQuery into the anonymous function.

window.helper = helper;