cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

            
              <div class="form-container fill-me-in">
  <form>
    <label class="form-row">
       <span class="label-text">A field</span>
       <input class="text-input" type="text" placeholder="a field" />
    </label>
    
    <label class="form-row">
       <span class="label-text">Another field</span>
       <input class="text-input" type="text" placeholder="another field" />
    </label>
    
    <label class="form-row">
       <input type="radio" name="group" />
       <span>A radio selection</span>
    </label>
    <label class="form-row">
       <input type="radio" name="group" />
       <span>A different one</span>
    </label>

    <input type="submit" class="button" />
  </form>
</div>
            
          
!
            
              * {
  box-sizing: border-box;
}

body {
  display: flex;
  font-family: 'Arial', 'san-serif';
  justify-content: space-around;
}

.form-container {
  border: 1px solid grey;
  padding: 1em;
  max-width: 25em;
  width: 40%;
}

.form-row {
  display: block;
  margin-top: 1em;
}

.label-text {
  display: block;
}

.text-input {
  font-size: 1em;
  margin-top: .25em;
  padding: .5em;
  width: 100%;
}

.button {
  border: none;
  display: block;
  font-size: 1.1em;
  margin: 1em 0 0;
  padding: .5em;
  width: 100%;
}
            
          
!
            
              gremlins.createHorde() // First, create our horde 
  .allGremlins()      // And enable all gremlins
  .gremlin(function() {
    // Now let's define our submission gremlin
    var targetElement, availableForms;

    availableForms = document.querySelectorAll('form'); // Let's get all available form elements on the page
    targetElement = availableForms[Math.floor(Math.random()*availableForms.length)]; // Then let's grab a random element from those results

    // Now, we create a dummy submission event
    var evt = document.createEvent('HTMLEvents');  // Create an event container
    evt.initEvent('submit');  // Define our event as a submit event
    targetElement.dispatchEvent(evt);  // Finally, dispatch the submit event onto our randomly selected form

    // We also want to make sure to log this event like others gremlins do!      
    console.log('gremlin submit ', targetElement);
  })
  .unleash();

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console