Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <input type="email" />
</body>
</html>
 
input:invalid {
  background-color: #ffdddd;
}
   
input:valid {
  background-color: #ddffdd;
}
   
input:required {
  border-color: #800000;
  border-width: 3px;
}
 
$(function () {
  $("input").blur(function () {
    if ($(this).is(":invalid")) {
      alert('invalid!');
    }
  });
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers