我为backbone.js 创建了一个简单的视图。
任何人都可以看到为什么这不会在点击时触发?
html/
<form id=hello>
Email:
<input class=email>
Password:
<input class=password>
<span id="submit">submit</span>
</form>
JS/
var FormView = Backbone.View.extend({
el: '#hello',
events: {
'click #submit': 'clicked'
},
clicked: function(){
console.log('clicked');
}
});
var formView = new FormView();