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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

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


                <script src="//"></script> 
<link href="//" rel="stylesheet">
<script src="//"></script>
<script src="//"></script>

<div class="panel panel-default">
  <div class="panel-heading">Lobby Chat</div>
  <ul class="list-group" id="chat-output"></ul>
  <div class="panel-body">
    <form id="chat">
      <div class="input-group">
        <input type="text" class="form-control" id="chat-input" />
        <span class="input-group-btn">
          <button type="submit" class="btn btn-default">Send Message</button>


                body {
  padding: 10px;
#chat-output {
  height: 150px;
  overflow-y: scroll;


                // use jQuery to find the DOM elements we care about
var $input = $('#chat-input'); // where the user inputs chat text
var $output = $('#chat-output'); // where output is sent

// start pubnub
var pubnub = PUBNUB.init({
  publish_key: 'demo',
  subscribe_key: 'demo'

var channel = 'memewarz-lobby-demo';

// when the "send message" form is submitted
$('#chat').submit(function() {
  // publish input value to channel 
    channel: channel,
    message: $input.val()
  // clear the input field
   // cancel event bubbling
  return false;

// when we receive messages
  channel: channel, // our channel name
  message: function(text) { // this gets fired when a message comes in
    // create a new line for chat text
    var $line = $('<li class="list-group-item" />');
    // filter out html from messages
    var $message = $('<span class="text" />').text(text).html();
    // build the html elements
    // scroll the chat output to the bottom