Backbone.JS ValidationError()

The Backbone.JS ValidationError() model is used to display an error, in case if a validation fails or after an invalid event is triggered.

Syntax:

Model.ValidationError 

Example:

 

  
Example  
  
  
  
  
  
  
  


  

Output:

Enter the correct age.

Explanation:
Since we set the value of student_age less than 10, hence it returned a Validation Error message.