Reputation: 134
Can anybody give a small example about how to load a new div container based on a mouse click, using Backbone.js? I would like to add a new div container to my already existing html contents.
Upvotes: 0
Views: 2866
Reputation: 7344
In a view class:
events: { "click #myButton": "insertDiv" }
insertDiv: function(event) {
this.$el.append("<div>...</div>");
}
Upvotes: 5