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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

    <title>Tabbed Form</title>
    <form name="myform" onsubmit="return validateForm()">
        <li class="title">Who Are You?</li>
        <li class="fields">
          <label>*First Name:</label><br />
          <input id="first_name" class ="req" type ="text" /><br />
          <label>Middle Name:</label><br />
          <input id="middle_name" type ="text" /><br />
          <label>Last Name:</label><br />
          <input id="last_name" type ="text" /><br />
          <label>*Email:</label><br />
          <input id="email" class ="req" type ="text" /><br />
        <li class="title">Where Are You?</li>
        <li class="fields">
          <label>City:</label><br />
          <input id="city" type ="text" /><br />
          <label>*State:</label><br />
          <input id="state" class ="req" type ="text" /><br />
          <label>Country:</label><br />
          <input id="country" type ="text" /><br />
        <li class="title"> What Do You Do?</li>
        <li class="fields">
          <label>*Occupation:</label><br />
          <input id="occupation" class ="reg" type ="text" /><br />
          <label>Company:</label><br />
          <input id="company" type ="text" /><br />
          <label>Company Location:</label><br />
          <input id="location" type ="text" /><br />
      <input type="submit" value="Submit Form" />
              body {
  width: 500px;
  margin: auto;
  text-align: center;

li {
  list-style: none;

li.fields {
  margin: 0;
  padding: 1em 0;

li.title {
  cursor: pointer;
  font-weight: bold;
  font-size: 1.5em;
  line-height: 2em;
  background: #e3e3e3;
  border-bottom: 1px solid #c5c5c5;
  border-top: 1px solid white;

.hide { display: none; }

              $(document).ready(function() {
  $('ul').on('click', 'li.title', function(){

function validateForm() {
  for(var i = 0; i < myform.elements.length; i++) {
    if(myform.elements[i].className == "req" && myform.elements[i].value.length == 0) {
      alert('Please fill in all required fields');
      return false;
  var email = document.getElementById('email').value;
  var atpos = email.indexOf('@');
  var dotpos = email.lastIndexOf('.');
  if (atpos < 1 || dotpos < atpos+2 || dotpos+2 >= x.length) {
      alert('Please type a valid email address');
    return false;
Loading ..................