Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

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

              
                
<html>
<head>
	<meta charset="utf-8">
	<meta name="veiwport" content="width-device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css">
  <link href="https://fonts.googleapis.com/css?family=Roboto:400,700,900i" rel="stylesheet">
	<title>Search Users</title>
</head>
<body>
<div class="container">
<h1 class="center-align">
Search Users
</h1>
<input type="text" id="filterInput" placeholder="Search names...">
<ul id="names" class="collection with-header">
	<li class="collection-header">
		<h5>A</h5>
	</li>
	<li class="collection-item">
		<a href="#">Abe</a>
	</li>
	<li class="collection-item">
		<a href="#">Adam</a>
	</li>
	<li class="collection-item">
		<a href="#">Alen</a>
	</li>
	<li class="collection-item">
		<a href="#">Anna</a>
	</li>
	<li class="collection-header">
		<h5>B</h5>
	</li>
	<li class="collection-item">
		<a href="#">Ben</a>
	</li>
	<li class="collection-item">
		<a href="#">Barbara</a>
	</li>
	<li class="collection-item">
		<a href="#">Bush</a>
	</li>
	<li class="collection-item">
		<a href="#">Bob</a>
	</li>
	<li class="collection-header">
		<h5>C</h5>
	</li>
	<li class="collection-item">
		<a href="#">Carlo</a>
	</li>
	<li class="collection-item">
		<a href="#">Costa</a>
	</li>
	<li class="collection-item">
		<a href="#">Ceh</a>
	</li>
	<li class="collection-item">
		<a href="#">Clent</a>
	</li>
  <li class="collection-header">
		<h5>D</h5>
	</li>
	<li class="collection-item">
		<a href="#">David</a>
	</li>
	<li class="collection-item">
		<a href="#">Dion</a>
	</li>
	<li class="collection-item">
		<a href="#">Driver</a>
	</li>
	<li class="collection-item">
		<a href="#">Durion</a>
	</li>
</ul>
</div>
<script type="text/javascript" src="euler.js"></script>
</body>
</html>
              
            
!

CSS

              
                body{
  font-family: 'Roboto', sans-serif;
  background: #a0afad;
}

              
            
!

JS

              
                // Get input element
    let filterInput = document.getElementById('filterInput');
    // Add event listener
    filterInput.addEventListener('keyup', filterNames);

    function filterNames(){
      // Get value of input
      let filterValue = document.getElementById('filterInput').value.toUpperCase();

      // Get names ul
      let ul = document.getElementById('names');
      // Get lis from ul
      let li = ul.querySelectorAll('li.collection-item');

      // Loop through collection-item lis
      for(let i = 0;i < li.length;i++){
        let a = li[i].getElementsByTagName('a')[0];
        // If matched
        if(a.innerHTML.toUpperCase().indexOf(filterValue) > -1){
          li[i].style.display = '';
        } else {
          li[i].style.display = 'none';
        }
      }

    }
              
            
!
999px

Console