I have this line of code that exist in a partial view. Jquery code resides in the index page hosting the partial view

```
        <div class="paythisamountbtn">@Html.ActionLink(T("Pay This Amount"), "InvoiceCheckout", null, new { @target = "InvoiceCheckout", @class = "amebtn" }): @String.Format("{0:C}", Model.TotalDue)</div>

```

I have a checkbox on every row of data. This is all within a webgrid. Here is what it looks like below

```
        @{
            var gridColumns = new List<WebGridColumn>();

            gridColumns.Add(grid.Column(format: (item) => 
                {
                    var s = "<input type=\"checkbox\" name=\"InvoiceNumber\" id=\"IN" +  item.InvoiceNumber.ToString() + "\" value=\"" + item.InvoiceNumber.ToString() + "|" + item.AmountDue + "\"";
                    if (item.IsSelected) {
                        s += "checked=\"true\"";
                    }
                    s+= "/>";
                    return s;
                }
                    , style: "box"));

        ...
        ...
        ...
        }

        function SetViewSelected(c) {   
                var s = 0;
                for (i = 0; i < $("input[name='InvoiceNumber']:checked").length; i++) {
                    invoice_details = $("input[name='InvoiceNumber']:checked")[i].value;
                    invoice_amount = invoice_details.split("|")[1];
                    s += parseFloat(invoice_amount);
                }
                alert(s);
                //$('.paythisamountbtn').val(s);
        }

```

As I check and uncheck the checkboxes, I want to be able to show the total on the line below as they change. At the moment the alert(s) gets me the new total 

```
        <div class="paythisamountbtn">@Html.ActionLink(T("Pay This Amount"), "InvoiceCheckout", null, new { @target = "InvoiceCheckout", @class = "amebtn" }): @String.Format("{0:C}", Model.TotalDue)</div>

```

I tried doing $('.paythisamountbtn').val(s); but the totaldue does not change as I check and uncheck the check boxes. 

How can I do this please?