Skip to content
Advertisement

Nan in jquery to view multiple row values

When I display single row value ((quantity * product) = total) it works.

enter image description here

But adding more values in a row using session causes it display an error like NaN when i change quantity values.

enter image description here

My code:

JavaScript

My Jquery script:

JavaScript

HTML Code:

JavaScript

Advertisement

Answer

You can use class and same way calculate final total

JavaScript
JavaScript

Old answer You should use Number for operation, so use parseInt and parseFloat

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement