Simple yet effective vanilla JavaScript validator.