Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

HTML

              
                <form class="save-me" id="save-me">

	<label for="name">Name</label>
	<input type="text" name="name" id="name" value="Mike Wazowski">

	<label for="address">Address</label>
	<input type="text" name="address" id="address" value="123 Scare Avenue, Monstropolis">

	<label for="email">Email</label>
	<input type="email" name="email" id="email" value="mikew@monstersinc.com">

	<label for="hear-about-us">How did you hear about us?</label>
	<select name="hear-about-us" id="hear-about-us">
		<option value=""></option>
		<option value="google">Google</option>
		<option value="referral">Referred by a Friend</option>
		<option value="tv" selected>A TV Ad</option>
		<option value="radio">A Radio Ad</option>
	</select>
  
  	<label for="hear-about-us-multi">How did you hear about us?</label>
	<select name="hear-about-us-multi" id="hear-about-us-multi" multiple>
		<option value=""></option>
		<option value="google">Google</option>
		<option value="referral" selected>Referred by a Friend</option>
		<option value="tv" selected>A TV Ad</option>
		<option value="radio">A Radio Ad</option>
	</select>

	<label id="more">Additional thoughts?</label>
	<textarea name="more" id="more">Laughter produces more energy than screams!</textarea>

	<p><strong>Do you agree to our terms of service?</strong></p>
	<label class="label-plain">
		<input type="radio" name="tos" value="yes" checked>
		Yes
	</label>
	<label class="label-plain">
		<input type="radio" name="tos" value="no">
		No
	</label>

	<p><strong>Pick your favorite university.</strong></p>
  
  <label class="label-plain">
		<input type="checkbox" name="scare-tech">
		Scare Tech
	</label>

	<label class="label-plain">
		<input type="checkbox" name="mu" checked>
		Monster University
	</label>

	<p><button type="submit">Submit</button></p>

</form>
              
            
!

CSS

              
                /**
 * Add box sizing to everything
 * @link http://www.paulirish.com/2012/box-sizing-border-box-ftw/
 */
/* line 38, src/sass/components/_normalize.scss */
*,
*:before,
*:after {
	box-sizing: border-box;
}

/**
 * Layout
 */
body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
	font-size: 112.5%;
	margin-left: auto;
	margin-right: auto;
	max-width: 40em;
	width: 88%;
}

/**
 * Forms
 */
[type="text"],
[type="email"],
select,
textarea {
	display: block;
	margin-bottom: 1em;
	width: 100%;
}

textarea {
	height: 8em;
}

label {
	display: block;
	font-weight: bold;
	margin-bottom: 0.25em;
}

.label-plain {
	font-weight: normal;
}
              
            
!

JS

              
                /*!
 * Serialize all form data into an array of key/value pairs
 * (c) 2020 Chris Ferdinandi, MIT License, https://gomakethings.com
 * @param  {Node}   form The form to serialize
 * @return {Array}       The serialized form data
 */
var serializeArray = function (form) {
	var arr = [];
	Array.prototype.slice.call(form.elements).forEach(function (field) {
		if (!field.name || field.disabled || ['file', 'reset', 'submit', 'button'].indexOf(field.type) > -1) return;
		if (field.type === 'select-multiple') {
			Array.prototype.slice.call(field.options).forEach(function (option) {
				if (!option.selected) return;
				arr.push({
					name: field.name,
					value: option.value
				});
			});
			return;
		}
		if (['checkbox', 'radio'].indexOf(field.type) >-1 && !field.checked) return;
		arr.push({
			name: field.name,
			value: field.value
		});
	});
	return arr;
};

var form = document.querySelector('#save-me');
var data = serializeArray(form);
console.log(data);
              
            
!
999px

Console