Help on JavaScript Function

On my Second form page, we added some JavaScript function to add some buttons on input elements:

We followed this link:

The buttons were added, but when the + or – button is pressed, the values are not being added/deducted on input. So the total is not update.

Can you help me? Thank you in advance.