Skip to main content
1 of 2
Jorge Silva
  • 4.6k
  • 1
  • 24
  • 43

You can do this a couple of ways.

The most simple, understandlbe way is to use the that variable:

var that; 
$('#' + this.ID + ' .selMake').on('change', that.getCarModel); // This will execute the function this.getcarModel

You can also use the bind method in browsers that support ES5.

$('#' + this.ID + ' .selMake').on('change', this.getCarModel.bind(this));

If you're using underscore you might want to use its _.bind function in order to make it cross-browser compatible:

$('#' + this.ID + ' .selMake').on('change', _.bind(this.getCarModel. this));
Jorge Silva
  • 4.6k
  • 1
  • 24
  • 43