Changing color of answer choices using JavaScript | XM Community
Skip to main content
Question

Changing color of answer choices using JavaScript

  • October 18, 2021
  • 4 replies
  • 664 views

Forum|alt.badge.img

I'm trying to change the color of the font for multiple choice answers to white using JavaScript. I know how to do this via the rich content editor. However, then the responses are also white while I am working on designing the survey, and I need to see the text while I am working on the survey, I tried:
jQuery(".Skin .QuestionText").css({"color":"white"});
and
jQuery(".Skin .QuestionChoiceText").css({"color":"white"});
suggestions?
Thank you.

4 replies

pogi
Level 2 ●●
Forum|alt.badge.img+14
  • Level 2 ●●
  • October 18, 2021

Are you trying to hide answer choices? You could use display logic to only show them based on specific criteria.


Forum|alt.badge.img
  • Author
  • October 18, 2021

Thanks much for trying to help.
I have the answers choices hidden. The issue is that they still briefly appear/flash during the survey. So I want to make the responses white (the same color as the background) so that when the choices briefly flash participants don't see them.


ames
Forum|alt.badge.img
  • November 18, 2021

You can also add custom CSS so it "disappears" on the screen.

  1. Go to Look & Feel editor

  2. Click Style, then navigate to the Custom CSS box

  3. Enter the following code; just be sure to change your question ID number (mine was 126):

.Skin #QID126 label.MultiAnswer, .Skin #QID126 label.SingleAnswer
{ background:#ffffff;
  border-color: #ffffff;
  color: #ffffff;
}


Forum|alt.badge.img
  • Author
  • November 18, 2021

Thank you - this is what I was looking for!