Using Javascript to shade some boxes in a matrix table | XM Community
Skip to main content
Question

Using Javascript to shade some boxes in a matrix table

  • April 24, 2023
  • 1 reply
  • 107 views

Forum|alt.badge.img+1

I have a matrix table with 5 columns, A,B,C,D,E. I would like to shade boxes in some rows for each question, the boxes shaded are not consistent across the survey. For instance, this would be the pattern of shading:

A,C,D

B,C,E

etc etc

Is this possible? Would someone be able to help me out with a hint on the code please?

 

1 reply

Shashi
Level 8 ●●●●●●●●
Forum|alt.badge.img+34
  • Level 8 ●●●●●●●●
  • April 25, 2023

Use the below code to shade column 1. Similarly, change the value of ‘n’ to shade the required columns

var n = 1;
jQuery("#"+this.questionId+" .c"+(n+3)).css("background","#d6d6d6")