I am new to jQuery.
I tried getting/summing some items from my django views in jQuery. This is what I have:
$(document).ready(function()
{
var sch = $('#sch-books');
var gov = $('#gov-books');
var total = sch.val() + gov.val();
$('#total').text("Total : " + total);
});
My template has this:
<div id="sch-books" class="h6 mb-1">School copies - <b>{{ s_books.count }}</b></div>
<div id="gov-books"class="h6 mb-1">Govt copies - <b>{{ g_books.count }}</b></div>
<div id="total"></div>
It displays Total :
May someone help me get it right..