[Solved] Calculate percentage with JavaScript
I run your code on my local env and then knew why NaN exception thrown out. The variable total is retrieved from html input element value according to your code above, but total variable will be string empty before executed line parseInt(cash)+parseInt(checks)+parseInt(coin);. After that, parseInt will return NaN after parse empty string to int. So … Read more