Javascript to change question background color | XM Community
Skip to main content

Would anyone be able to share JavaScript code to change the background color of individual questions, but leave the background color of the choices as is? Can’t be applied to the whole survey, just certain individual questions. I have a specific hex code, not a color name. Trying to mimic the idea below…

 

 

To change just the background color of the Question Text and change font color to white, you can try the below JavaScript:

jQuery("#"+this.questionId+" .QuestionText").css({"background-color":"#A20A35","color":"#FFFFFF"});

 


This worked! Thank you so much!


Leave a Reply