HOW TO VARY THE COLORS OF DIFFERENT ANSWERS IN A MULTIPLE CHOICE QUESTION | XM Community
Skip to main content

Please help.
I want each of my survey response options to be different colors when selected. Currently, the survey answers look like this:
OPTIONS-2.png. . . and, when they are selected, all have the same blue color of the option below:
OPTIONS-FILLED.pngGoal: Different colors for each selected option. For a previous assignment, a community member kindly shared HTML code that I inserted in the HTML view area for the question and it worked great. Out of necessity, I modified the parameters of the code for this assignment (e.g., QID# and label name) (see below) but it doesn't work at all this time. Can anyone PLEASE tell me why the code isn't working and, most importantly, how to fix it? Getting somewhat desperate, tbh. (The survey has 5 multiple choice, multi-answer questions, and I'd like to insert correct code for each survey question - just as did in the previous assignment that I referred to. Also, unfortunately, I do not have Java script.)
Code that I thought would work, but it's not:



Check for the ID (using inspect element) of the option you want to change the color for and insert the following code in look & feel>style>css.

[id='QID14-1-label'].q-checked {
  background-color : Yellow !important;
}

The above code will change the color for the 1st option to yellow when selected.
You can apply the same code for remaining options as well by just changing the id.


Leave a Reply