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="fileUpload">
                <a href="" target="_blank"> - Learn Full Stack Development</a>
      <h1>Upload Multiple Image Files using JavaScript File API</h1>
      <div id="upload" class="upload">
         <input type="file" multiple onchange="showFile()" accept="image/*">
      <ul id="preview"></ul>


                @import url(;

body {
   margin: 2em;
   background: #e4e4e4;
   font-family: "Arimo",
   text-align: center;

a {
  color: blue;
  font-size: 13px;
  text-decoration: none;

hr {
   opacity: .3;
   margin: 2em 0;

.fileUpload {
   background: white;
   padding: 25px;
   margin: 0 auto;

div#upload {
   display: inline-block;

input[type="file"] {
background: #7886d8;
padding: 15px 11px 18px 20px;
border-radius: 4px;
cursor: pointer;
color: white;
width: 159px;
border: 2px solid #3F51B5;
outline: 0;

ul#preview {
   list-style: none;
   margin: 25px auto;
   padding: 0;
   display: block;
   max-width: 600px;

ul#preview li {
   display: inline-block;
   margin: 0 10px 10px;
   max-width: 100px;

ul#preview li img {
   width: 100%;


                   // Check HTML5 File API Browser Support
   if (window.File && window.FileList && window.FileReader) {
       function showFile() {
           var preview = document.getElementById("preview");
           var fileInput = document.querySelector("input[type=file]");

           for (var i = 0; i < fileInput.files.length; i++) {
               var reader = new FileReader();
               reader.onload = function(readerEvent) {
                   var listItem = document.createElement("li");
                   listItem.innerHTML = "<img src='" + + "' />";
   } else {
       alert("Your browser is too old to support HTML5 File API");