Bind backbone event to a multiple class selector

orad picture orad · Apr 12, 2013 · Viewed 11.5k times · Source

I can't get the following event to attach to my element.

events = {
   "change .date-selector .date-range": "dateRangeSelectionChanged"
}

Is this supported at all in Backbone.js? Or am I using a wrong syntax?

Answer

techvineet picture techvineet · Feb 27, 2014

You can separate the selectors by comma(',')

events: { "change .date-selector,.date-range": "dateRangeSelectionChanged" }