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.


Auto Save

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.


<p>This is a quick and dirty example to accompany my blog post <a href="">Considering dynamic search results and content</a>. Its primary purpose is to show how an accessible description can be added to a search field that dynamically renders results in the same page. Additionally, if you enter 5+ characters into the text field, an error message will appear saying there are no results.  Again, this is a very quick example.</p>

<a href="">read about why i made this thing</a> which, lol, is whack without context.

<search role=search>
	<h2><label for=s>Find a thing</label></h2>
	<input id=s aria-describedby=foo>

	<h3 tabindex=-1>
		<!-- this is hard coded examples are hard coded -->
		<span id=no hidden>2 available</span>
	<div id=foo>Results will update as you type</div>
	<div id=r></div>
	<div aria-live=assertive aria-atomic=true id=a></div>


                body {
	padding: 1em;

details {
	margin-bottom: 1.25em;

h2 {
	margin: 0 0 .5em;;

h3 span {
	display: block;
	font-size: .625em;
	font-weight: normal;

search {
	display: block;
	border: 1px solid #ccc;
	padding: 2em;


                const field = document.getElementById('s');
const desc = document.getElementById('foo');
const results = document.getElementById('r');
const live = document.getElementById('a');
const msg = 'No results found!';
const heading = document.querySelector('h3')
const num = document.getElementById('no');
const list = `<ul><li><a href="#">a thing</a></li><li><a href="#">another thing</a></li></ul>`

heading.addEventListener('keyup', function ( e ) {
	if ( e.key == "Escape" ) {

field.addEventListener('keyup', function ( e ) {
	if ( e.key == 'Enter' ) {
	if ( this.value !== '' ) {
		desc.hidden = true;
	if ( this.value.length > 5 ) {
		live.textContent = msg;
		results.innerHTML = '';
		num.hidden = true;
	else if ( this.value === '' ) {
		results.innerHTML = '';
		desc.hidden = false;
		num.hidden = true;
	else {
		live.textContent = '';
		results.innerHTML = list;
		num.hidden = false;