I’ve got the following jQuery code:
var total = parseFloat($(".hidden-total").text());
For some reason or other, total is being returned as NaN.
Could anyone suggest why?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
what is inside of hidden-total? and how many of those are there?
.text() returns the concatenated string of all of the hidden-total class and other element inside of it. so if you have more than 1 it probably won’t work