/* I have a handlebar template as */
<strike><div id="tab-template-id" class="citi-layouts-container">
<div id="tabRegion" id="citi_apps_landing_heroContainer" >
{{#each values}}
<a id="{{id}}" class="btn-large">{{id}}</a>
{{/each}}
</div></strike>
/* problem: */
/* I could not able to click the dynamically created button id
使用骨干js * /
在布局中使用事件答案 0 :(得分:2)
render() {
var count = 15;
var Data1 = [];
for (var i = 0; i < count; i++) {
Data1.push({
id: "tab" + i
});
}
var items = new Items(Data1);
this.collection = items;
$(this.el).html(this.template({
values: this.collection.toJSON()
});
$.extend("events", {"click .btn-large": "your function"})
}
&#13;