Validation library in JavaScript
Is there any validation library in JavaScript? I'm looking for something small, simple and basic.
Example 1
var email = "steve@jobs.com";
if ( validate(email, "email") ) {
// Success
}
Example 2
var email = "steve@jobs.com";
if ( validate(email, {
"length": [0, 12],
"characters": ["a", "b", "c", "d", "e", ...],
}) ) {
// Success
}
Thank you.