Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>test label</title>
</head>
<body>
  <div>
    <input id="input" type="number" required />
    <label for="input">:</label>
  </div>
</body>
</html>
 
div {
  float: left;
}
label {
  float: right;
  padding-right: 10px;
}
label:before {
  content: 'Phone';
  color: black;
  
  -webkit-transition: color 0.5s;
  -moz-transition: color 0.5s;
  -ms-transition: color 0.5s;
  -o-transition: color 0.5s;
  transition: color 0.5s;
}
input {
  float: right;
}
input:focus + label:before {
  content: 'Numbers only';
  color: orange;
}
input:focus:valid + label:before {
  content: 'Looks good';
  color: blue;
}
input:valid + label:before {
  content: 'Nice number';
  color: green;
}
Output

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

Dismiss x
public
Bin info
Brook Jordanpro
0viewers