Good evening. I have a js where I need it to run when loading the page. It works when I click, but I can not get the calculation done automatically when loading the page.
$(document).ready(function(){
executa5();
$(".cubagem, .tabbable").on('click mouseover load', executa5);
function executa5(){
valorTotaldaNota = $("#valorTotaldaNota").val();
valorTotaldaNota = valorTotaldaNota.replace(".", "");
valorTotaldaNota = valorTotaldaNota.replace(",", ".");
adValorem = $("#adValorem").val();
gris = $("#gris").val();
v1 = valorTotaldaNota * adValorem / 100;
v2 = valorTotaldaNota * gris / 100;
v1v2 = v1+v2;
$("#valordoSeguro").val( v1v2.toFixed(2) );
};
});
What am I doing wrong?