I am trying to define a variable 'res' which will contain the value of the participant's response to a question. I have the following code which is working fine.
var res =Number(document.getElementById('QR~QID1').value);
However, I don't want to insert the question id manually for every question, but have the code directly pull the question id. I know var qid= this.questionId; returns the question id. But I can't seem to figure out the syntax for using this variable directly. Any help will be much appreciated!
Best answer by rondev
View original