No need to retrieve the input with js.
You can keep track of the values using variables and workflows.
- create a variable of type object
- on your inputs add a workflow triggered on change where you change the variable
Now on submit you can access the values: