The below for loop produces an error in the html output, I substituted with other function and the html output was fine, so I'm convinced its this function. I also recreated it in an ide substituting $("#car").html(year); for console.log(year); and it produced the correct output. What is the problem with this function?
function cgr() {
for (var year = 0; (churn * total_customer) < leadcon; year++) {
total_customer = total_customer + leadcon;
if ((churn * total_customer) >= leadcon) {
$("#car").html(year);
}else {
$("#car").html("something is wrong");
};
}
}
full script can be found here: http://pastebin.com/DcDKNfux
$("#car")in a for loop without abreak;statement after success !(why?) .