Reputation: 83
My click Event is not Firing in backbone.js.I have search alot but my problem is not resolved. following is the code:
EventView=Backbone.Model.extend({
el:'modal_box',
events: {
'click #btn': 'insertText',
'click .btndel': 'delme'
},
insertText: function (e) {
alert('text inserted');
},
delme: function (e) {
alert('text inserted');
}
}); AND HTML IS
<div class="modal_box">
<button id="btn" >Add a Task </button>
<button class="btndel" >delete all</button>
Upvotes: 0
Views: 76
Reputation: 71
For "el", you should supply a selector. Try:
el: '.modal_box',
...
Upvotes: 2