0
我想在動態創建的拖放框上觸發on_change事件。 ,但不知道如何做到這一點的骨幹JS如何在循環中調用視圖事件js
here is my html code creating a div tag
<div id="page">
<input type="button"id="btn1"value="ok">
</div>
和我的骨幹代碼我在哪裏動態地
var btn2id ="";
var app = {};app.v1 = Backbone.View.extend({
el: '#page',
events: {
'click #btn1' : 'f1',
},
f1:function()
{
alert("Boom");
btn2id="btn2";
for(var j=0;j<3;j++) {
$('#page').append('<select id="selecty'+j+'"></select>');
for(var i=0;i<10;i++){
$('#selecty'+j+'').append('<option value="'+i+'">'+i+'</option>');
}
vv = new app.v2();}}
}
});
app.v2 =Backbone.View.extend({
el: '#page',
events:{
at this place i have no idea what to do
// for(int i=0;i<3;i++){
// 'change '#selecty'+i+'' : 'f2',
// }
},
f2:function() {
alert("Boom again");
}
v = new app.v1();
});
v = new app.v1();
如果所有這些額外的觀點是太重了,只需添加一個'class'到''