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.


                <div class="drop">Drag'n'Drop File Here</div>
<div class="list"></div>
<div class="status"></div>

<input type="file" name="cycleDocument" id="cycleDocument" class="" tabindex="" />


URL's of snips'n'scripts'n'helps etc...

gonna try this next @


the one i'm deleted on @
...will ask about this one being edited too...

full page drag and drop files website

why is file drag and drop disabling draggable elements?

Passing path to uploaded file from HTML5 drag & drop to input field


article jsfiddle comment is from @ 

Using HTML5 and the Blueimp jQuery-File-Upload Plugin To Upload Large Files 

Responding to HTML5 FileReader Events 

Working With the Drag and Drop API in HTML5 

HTML 5 Drag & Drop Basics 

Move Data and DOM Elements using Drag & Drop 


g-search: how to add simple drag & drop into current file upload form field @

g-search: restrict file drag and drop to single file @'&ie=UTF-8&oe=UTF-8#newwindow=1&rls=en&q=restrict+file+drag+and+drop+to+single+file



                .drop {
    min-height: 50px;
    width: 250px;
    border: 1px solid blue;
    margin: 10px;
    padding: 10px;


// code by Commenter JacobEdmondKerr said on February 26, 2013 at 10:05 pm - demo @     

if(window.FileReader) { 
  //var drop; 
  addEventHandler(window, 'load', function() {
    var status = document.getElementsByClassName('status')[0];
    var drop   = document.getElementsByClassName('drop')[0];
    var list   = document.getElementsByClassName('list')[0];

    function cancel(e) {
      if (e.preventDefault) { 
      return false;

    // Tells the browser that we *can* drop on this target
    addEventHandler(drop, 'dragover', cancel);
    addEventHandler(drop, 'dragenter', cancel);
    addEventHandler(drop, 'drop', function (e) {
      e = e || window.event; // get window.event if e argument missing (in IE)   

      if (e.preventDefault) { 
      } // stops the browser from redirecting off to the image.

      var dt = e.dataTransfer;
      var files = dt.files;
      for (var i=0; i<files.length; i++) {
        var file = files[i];
        var reader = new FileReader();

        //attach event handlers here...
        addEventHandler(reader, 'loadend', function(e, file) {
          var bin = this.result; 

          //	div.list...
          var newFile       = document.createElement('span');
          newFile.innerHTML = 'Selected File: '' (size: '+file.size+' bytes)';
          //  var fileNumber = list.getElementsByTagName('div').length;

          //	div.status...
          status.innerHTML = 'This file is ready to be uploaded upon submission.';

          //status.innerHTML = fileNumber < files.length 
          //? 'Loaded 100% of file '+fileNumber+' of '+files.length+'...' 
          //: 'Done loading. processed '+fileNumber+' files.';

          // var img = document.createElement("img"); 
          // img.file = file;   
          // img.src = bin;
          // list.appendChild(img);

      return false;

    Function.prototype.bindToEventHandler = function bindToEventHandler() {
      var handler = this;
      var boundParameters =;
      //create closure
      return function(e) {
        e = e || window.event; // get window.event if e argument missing (in IE)   
        handler.apply(this, boundParameters);
} else { 
  document.getElementsByClassName('status')[0].innerHTML = 'Your browser does not support the HTML5 FileReader.';
function addEventHandler(obj, evt, handler) {
  if(obj.addEventListener) {
    // W3C method
    obj.addEventListener(evt, handler, false);
  } else if(obj.attachEvent) {
    // IE method.
    obj.attachEvent('on'+evt, handler);
  } else {
    // Old school method.
    obj['on'+evt] = handler;