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>Manual Form Validation</h1>
<p>Only triggers validation in modern browsers (aka, everything but IE). Makes it easier to control the flow of form validation (e.g., for custom, multi-step forms).</p>
<p><strong>Disclaimer</strong>: Only do this is you really, really, really need to and don’t care about broken forms in IE.</p>

<!-- Add `novalidate` to manually trigger validation -->
<form id="form" novalidate>
	<label for="name">Enter your name:</label>
	<input id="name" name="name" type="text" required>

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

	<li><a href="" target="_blank" rel="noopener">MDN: HTMLObjectElement.checkValidity()</a></li>
	<li><a href="" target="_blank" rel="noopener">MDN: HTMLFormElement.reportValidity()</a></li>





                var form = document.getElementById('form');
var supportsValidation = typeof(form.reportValidity) === 'function';

console.log('supportsValidation', supportsValidation);

form.addEventListener('submit', function(event) {
	// If browser supports validation and the form
	// is currently invalid, report errors!
	if (supportsValidation && !form.checkValidity()) {
	// Otherwise, submit the form!