Kyle
Kyle

Reputation: 23

Function not working to calculate score and change value of page element

I have a calculator file that I am trying to modify to allow me to execute the calculation function more than once at a time.

To elaborate, I can currently use the calculator to get one score at a time however I would like it to accept more than one column of values and spit out a score under each column.

My script is currently not changing the values of the elements used to display them.

Upvotes: 2

Views: 63

Answers (1)

epascarello
epascarello

Reputation: 207531

You are looking for id="collectSlack[i]" not a number

document.getElementById("collectSlack[i]").value;

needs to be

document.getElementById("collectSlack["+ i + "]").value;

Upvotes: 1

Related Questions