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>Upload File Example</h1>

<form id="form">
	<label for="file">Select file:</label>

	- Value =	A DOMString representing the path to the selected file.
	- IDL attributes = files and value

	<input id="file" name="file" type="file" accept="image/png, image/jpeg">
	<button type="submit">Upload</button>

	<li><a href="" target="_blank" rel="noopener">MDN: &lt;input type=&quot;file&quot;&gt;</a></li>
	<li><a href="" target="_blank" rel="noopener">MDN: Common MIME types</a></li>
	<li><a href="" target="_blank" rel="noopener">MDN: FileList</a></li>
	<li><a href="" target="_blank" rel="noopener">MDN: File</a></li>
	<li><a href="" target="_blank" rel="noopener">MDN: Blob</a></li>
	<li><a href="" target="_blank" rel="noopener">Can I use… Blob constructing</a></li>





                form.addEventListener('submit', function (event) {

	// NOTE: Does not throw error because `files` is an object
	// and is always defined. (You can also use `.item(0)`.)

	// "A File object is a specific kind of a Blob, and can be
	// used in any context that a Blob can. In particular,
	// FileReader, URL.createObjectURL(), createImageBitmap(),
	// and XMLHttpRequest.send() accept both Blobs and Files."

	// File
	// {
	//   lastModified: 1597112437000,
	//   name: 'example.png',
	//   size: 200000,
	//   type: 'image/png',
	//   webkitRelativePath: ''
	// }