Change answer field color within a matrix question | XM Community
Skip to main content

I would like to change the background color of some, but not all, answer fields within a constant sum matrix question. See below for an example of what I would like the question to look like. What is the code I would need to accomplish this?
Capture.JPG

After column G their must be a total box column.
Try the below code:
var arr = [8,16,17,24,25,26,32,33,34,35,40,41,42,43];
for(var i=0;i jQuery("#"+this.questionId+" input[type='text']:eq("+arr[i]+")").css("background","#d6d6d6");

The array has the index (starting from 0) of the text input for which we need to change the color, so modify the array and get the required result.


Leave a Reply