Skip to content
Advertisement

How to find sum of multiple inputs (inputs can increase by add button) from different containers?

JavaScript
JavaScript

I want to update value of sumOfTotal every time I change input values. BUT each of someOfTotal boxes values have to be their div’s numbers’ sum.

Summary, each div has their own output (sumOfTotal) and inputs (number class). And each div’s own output has to be its own numbers’ sum.

Advertisement

Answer

First, I will recommend using event listeners instead of the inline javascript. Try this

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