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.


                <h1>Vanilla JS Drag & Drop upload zone for input file element</h1>

<div class="dropzone" id="dropzone">
    <img class="dropzone-icon" src="" />
    Drop files or Click here to select files to upload.
    <input type="file" name="files" class="dropzone-input" multiple />


                @import url(';500;700&display=swap');
body {
  font-family: "Roboto";
h1 {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid lighten(#6583fe, 15%);
  font-size: 1.5rem;
  font-weight: 400;
.dropzone {
  border: 0.2rem dashed #6583fe;
  padding: 2rem;
  border-radius: 0.25rem;
  background-color: #fff;
  text-align: center;
  font-size: 1.5rem;
  transition: 0.25s background-color ease-in-out;
  cursor: pointer;
  &:hover {
    background-color: lighten(#6583fe, 28%);
  &-icon {
    max-width: 75px;
    display: block;
    margin: 0 auto 1.5rem;
  &-input {
    display: none;



                var dropzone = document.getElementById('dropzone');
var dropzone_input = dropzone.querySelector('.dropzone-input');
var multiple = dropzone_input.getAttribute('multiple') ? true : false;

['drag', 'dragstart', 'dragend', 'dragover', 'dragenter', 'dragleave', 'drop'].forEach(function(event) {
  dropzone.addEventListener(event, function(e) {

dropzone.addEventListener('dragover', function(e) {
}, false);

dropzone.addEventListener('dragleave', function(e) {
}, false);

dropzone.addEventListener('drop', function(e) {
  var files = e.dataTransfer.files;
  var dataTransfer = new DataTransfer();
  var for_alert = "";, file => {
    for_alert += "# " + +
		" (" + file.type + " | " + file.size +
		" bytes)\r\n";
    if (!multiple) {
      return false;

  var filesToBeAdded = dataTransfer.files;
  dropzone_input.files = filesToBeAdded;
}, false);

dropzone.addEventListener('click', function(e) {;