I have a page where I'm displaying some number in divs. I want to add the numbers in 2 divs and I want to display the total in a 3rd div.
If I enter the below script in the developers console it works, but I'm not able to load the script into the page.
div3.innerHTML = parseInt(div1.innerHTML) + parseInt(div2.innerHTML)
;
jQuery approach I tried -
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
var vtotal = $('#total').text();
var varch = $('#archTotal').text();
var vall = $('#alltotal').text();
vall = parseInt(vtotal) + parseInt(varch);
});
</script>