Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

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


	<input id="filesToUpload" type="file" multiple>
	<button id="testUpload">Test Upload</button>

<div id="status"></div>




                document.addEventListener('DOMContentLoaded', init, false);

let fileField, statusDiv;

async function init() {
	fileField = document.querySelector('#filesToUpload');
	statusDiv = document.querySelector('#status');
	document.querySelector('#testUpload').addEventListener('click', doUpload, false);

async function doUpload(e) {
	statusDiv.innerHTML = '';

	let totalFilesToUpload = fileField.files.length;
	//nothing was selected 
	if(totalFilesToUpload === 0) {
		statusDiv.innerHTML = 'Please select one or more files.';

	statusDiv.innerHTML = `Uploading ${totalFilesToUpload} files.`;

	let uploads = [];	
	for(let i=0;i<totalFilesToUpload; i++) {
	await Promise.all(uploads);
	statusDiv.innerHTML = 'All complete.';

async function uploadFile(f) {
	console.log(`Starting with ${}`);
	let form = new FormData();
	form.append('file', f);	
	let resp = await fetch('', { method: 'POST', body:form });
	let data = await resp.json();
	console.log(`Done with ${}`);
	return data;
	form.append('name', 'ray');
	form.append('age', 48);
	let resp = await fetch('', { method: 'POST', body:form });
	let data = await resp.json();