I'm trying to create a simple calculator using jQuery and been stick with the NaN result for a few hours now. Not sure what i'm missing or where i made a mistake. Basically i just want to multiply 2 input fields.
A help would be great!
var b = jQuery('input[name="mpfc-not-f"]').val();
var c = jQuery('input[name="atv-f"]').val();
total_rev = 0;
total_rev = Math.round(b * c);
totals_rev = total_rev.toString().replace(/(d)(?=(d{3})+(?!d))/g, "$1,");
jQuery(".over-total").text(totals_rev);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="text" value="0" name=" mpfc-not-f" class="mpfc-not"/>
<input type="text" value="0" name="atv-f" class="atv"/>
<p class="over-total">0</p>