the red validation class doesn't apply on jquery

JavaScript
  highlight: function(element) {
    $(element).parent().addClass('has-error');
  },
  unhighlight: function(element) {
    $(element).parent().removeClass('has-error');
  },

Source

Also in JavaScript: