How to append a html div to the current Backbone view?

1k views Asked by At

I am a beginner in Backbone.js. I was just wondering, is it possible to append html inside a extended Backbone View function?

SplitDialog: function() {
    var self = this;
    // appending a template
    $(self.el).append(tpl.percentageSplitDialog());

    // the below line does not work!
    $(self.el).append('<div>Hello, I can append here!</div>');

    ...

}

If yes, how and if not why it's not possible to append html like that inside a function. Any explanation would be really helpful. Thanks!

0

There are 0 answers