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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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>Filter by team</h1>
<a href="#" class="btn-player" data-team="chelsea">Chelsea</a>
<a href="#" class="btn-player" data-team="psg">Paris St-Germain</a>
<a href="#" class="btn-player" data-team="real-madrid">Real Madrid</a>
<a href="#" class="btn-player" data-team="barcelona">Barcelona</a>
<a href="#" id="btn-show-all">SHOW ALL PLAYERS</a>

<div class="player" data-players-team="chelsea">Cesc Fabregas</div>

<div class="player" data-players-team="psg">Zlatan Ibrahimović</div>
<div class="player" data-players-team="real-madrid">Cristiano Ronaldo</div>

<div class="player" data-players-team="chelsea">Didier Drogba</div>

<div class="player" data-players-team="chelsea">John Terry</div>

<div class="player" data-players-team="barcelona">Lionel Messi</div>

<div class="player" data-players-team="real-madrid">Sergio Ramos</div>

<div class="player" data-players-team="chelsea">Thibault Courtois</div>

<div class="player" data-players-team="psg">Thiago Motta</div>



                body {
  background-color: rgba(60, 105, 145, 1);
  color: rgba(255, 255, 255, 1);
  font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif;
  font-size: 20px;

a {
  margin:0 5px;

a:link {
  color: rgba(100, 255, 0, 1); 

a:visited {
  color: rgba(100, 255, 0, 1); 

a:hover {
  color: rgba(0, 255, 193, 1);
  text-decoration: none; 

.player {
  margin: 15px 0;


                var getLinkType, getElType, getElNotType;

$( ".btn-player" ).click(function(){
  // Feature-detect for dataset support
  if( !this.dataset ) {
    getLinkType = this.getAttribute( "data-team" );
   } else { // For other browsers
     getLinkType =;
  getElType = $( "div[data-players-team*="+getLinkType+"]" );

  getElNotType = $( "div[data-players-team!="+getLinkType+"]" );

   $( ".player" ).filter( getElNotType ).css( "display", "none" );
   $( ".player" ).filter( getElType ).css( "display", "block" );

$( "#btn-show-all" ).click(function() {
  $( ".player" ).css( "display", "block" );