Welcome aboard! We are happy you are here and wish you good net-raft!
<script type="text/javascript"> 
var Rank = Backbone.Model.extend({
defaults: {
lang: 'backbone.js',
rank: 3,
},
initialize : function(){
this.on("invalid",function(model,error){
document.write(error);
});
},
validate: function(attributes) {
if ( attributes.rank > 3 ) {
return 'Your rank is grater than 3!';
}
if ( attributes.rank < 3 ) {
return 'Your rank is less than 3!';
}
if ( ! attributes.lang ) {
return 'please enter the language name!!!';
}
},
});
var rank = new Rank();
rank.on('invalid', function() {
this.arguments;
});
rank.set({ rank : 4}, { validate : true }); 
</script> 
result: Your rank is grater than 3! 
The most helpful BACKBONE.JS solutions