Stack Exchange
How to interact between backbone view and html template file of text! plug-in
I loop data in quoteTemplate.html(using text! plug-in)  then I got one variable total=100, and I want to print total value in my view according to checkbox event : 
var testView = Backbone.View.extend({
    initialize: function() {
    },
    el: '#container',
    events : {
        'change [name=chkIncludeTotal]' : 'checkboxHandler'
    },
    checkboxHandler : function (e) {
        if($(e.currentTarget).is(':checked')){
            $('#total').html(total);
        }else{
            $('#total').html(0);
        }
    },
    render: function(){
        var cartPanel = _.template(CartPanel);
        this.$el.html(cartPanel);

        var aa = _.template(AATemplate);
        var bb = _.template(BBTemplate);
        var cc = _.template(CCTemplate);

        var dd = _.template(eeTemplate, {data : test.showEEtemplate() , total:total});

       $('#div1').html(bb);
       $('#div2').html(cc);
       $('#div3').html(dd);

    }
});

I really don't know how can I take total from html template file to use in the view.
Any help would be much appreciated, thank you.

ah, it's my bad typo, I will update it. total didn't store in my view, because total is the value that I increase it in the loop of html file.

What is the type of total in the html? Can't you just use $("#total").val() ?

@muistooshort : If I toss it, then how can I call total in checkboxHandler function.

Did you mean, like I store total in hidden field, then I pull it out using $('#hiddenID').val() ?
