Pen Settings

HTML

CSS

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

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

              
                <div id="wrapper">
  <div id="error"></div>
<form id="validation">

  
  <label for="email">Email</label>
  
  <input name="email" id="email" class="inputs"/>
 
  <label for="phone">Telephone</label>
  <input name="phone" id="phone" class="inputs"/>
  
  <label for="password">Password</label>
  <input type="password" name"password" id="password" class="inputs"/>
  
  <label for="password">Confirm Password</label>
  <input type="password" name"password" id="cpass" class="inputs"/>
  
  <input type="submit" value="Submit" id="btn" />
  </form>
</div>
              
            
!

CSS

              
                body{
  background:#232323;
}

#wrapper{
  width:600px;
  margin:0 auto;
  
  
}
#validation{
  background:#494949;
  border-radius:450px;
  padding:30px;
  border:1px solid yellow;
}
input{
  width:180px;
  padding:5px;
  border-radius:10px;
  border:1px solid;
  
  
}
label{
  width:200px;
  float:left;
  padding:5px;
  color:yellow;
  margin-left:15px;
  margin-right: -15px;

}

#btn{
  margin-left:40%;
  margin-top:20px;
  background:black;
  color:yellow;
  font-size: 16px;
} 

#error{
  color:red;
  font-size:22px;
  text-align:center;
}
              
            
!

JS

              
                $("#validation").submit(function(event){
  var errorMessage="";
    event.preventDefault();

  
  // in the function for valid email address it created a function that checks to see if the email address is valid or not
  
  function isValidEmailAddress(emailAddress) {
    var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
    return pattern.test(emailAddress);

    
};

  if(!isValidEmailAddress($("#email").val())){
    
    errorMessage="This is not a valid email";
    
  
  }
  
  if(!$.isNumeric($("#phone").val())){
    
    errorMessage=errorMessage+"<br/>This is not a valid number";
 
  }
  
  if($("#password").val() != $("#cpass").val()){
    
       errorMessage=errorMessage+"<br/> This is not a valid password";
    
  }
  
  if (errorMessage==""){
   alert("success");
  } 
  
  else{
     $("#error").html(errorMessage);
  }
 });

$(".inputs").mouseenter(function(){
  var input={
    background:"yellow",
    color: "black"
    
  }
  $(this).css(input);
})
$(".inputs").mouseleave(function(){ 
  var styles= {
    background: "black",
     color: "white"
  }
  $(this).css(styles)
})
              
            
!
999px

Console