Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>pattern-validated text input</title>
</head>
<body>
  <form>
    <label for="price">price</label>
  <input name="price" type="text" pattern="(\$|£|€)?\d+(\.\d{2})?" required>
    <br><input type="submit" value="submit">
  </form>
    
    
</body>
</html>
 
input:required:valid{
  background-color:lime;
}
input:required:invalid{
  background-color:yellow;
}
Output

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

Dismiss x
public
Bin info
rgbkpro
0viewers