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


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.


                <div class="container">
  <h2 class="title">Registrarme</h2>
  <form action="#" name="registration">

    <label for="firstname">Nombre</label>
    <input type="text" name="firstname" id="firstname" placeholder="John">

    <label for="lastname">Apellidos</label>
    <input type="text" name="lastname" id="lastname" placeholder="Doe">

    <label for="email">Email</label>
    <input type="email" name="email" id="email" placeholder="">

    <label for="password">Contraseña</label>
    <input type="password" name="password" id="password" placeholder="&#9679;&#9679;&#9679;&#9679;&#9679;">

    <button type="submit">Registrarme</button>

  <div class="article-reference">
    El artículo donde se explica este ejemplo lo puedes encontrar en 
    <a href="" target="_blank">¿Cómo validar un formulario con jQuery en solo dos minutos?</a> en <a href="" target="_blank">Estrada Web Group</a>.


                @import url("");

/* Styles */
* {
  margin: 0;
  padding: 0;

body {
  font-family: "Open Sans";
  font-size: 14px;

.container {
  width: 500px;
  margin: 25px auto;

.title {
  margin-bottom: 1rem;

form {
  padding: 20px;
  background: #2c3e50;
  color: #fff;
  border-radius: 4px;
form label,
form input,
form button {
  border: 0;
  margin-bottom: 3px;
  display: block;
  width: 100%;
form input {
  height: 25px;
  line-height: 25px;
  background: #fff;
  color: #000;
  padding: 0 6px;
  box-sizing: border-box;

form button {
  height: 30px;
  line-height: 30px;
  background: #e67e22;
  color: #fff;
  text-transform: uppercase;
  font-weight: bold;
  margin-top: 1.5rem;
  cursor: pointer;
form .error {
  color: #ff0000;

.article-reference {
  margin-top: 15px;
.article-reference a {
  color: #e67e22;


                // Wait for the DOM to be ready
$(function() {
  // Initialize form validation on the registration form.
  // It has the name attribute "registration"
    // Specify validation rules
    rules: {
      // The key name on the left side is the name attribute
      // of an input field. Validation rules are defined
      // on the right side
      firstname: "required",
      lastname: "required",
      email: {
        required: true,
        // Specify that email should be validated
        // by the built-in "email" rule
        email: true
      password: {
        required: true,
        minlength: 5
    // Specify validation error messages
    messages: {
      firstname: "Por favor, introduzca su nombre",
      lastname: "Por favor, introduzca su apellido",
      password: {
        required: "Por favor proporcione una contraseña",
        minlength: "Su contraseña debe tener al menos 5 caracteres."
      email: "Por favor, introduce una dirección de correo electrónico válida"
    submitHandler: function(form) {