Hi All
We are aiming to make the button to have colour while the respondent select the score, if they select 8 for example, 0-8 will also have the colour, and the 0-6 will be in red colour ,7-8 in yellow color.
I've updated the custom code inside that nps question,it is not getting color for the last number.
for example: selected 9 means it showing color for 0-8 fine but 9 is not geting color.placed my code here.
Please help me resolve
Qualtrics.SurveyEngine.addOnload(function()
{
jQuery('.ColumnLabel.First').css('color','red');
jQuery('.ColumnLabel.Last').css('color','green');
var qid = this.questionId;
var leftpoint = document.getElementById(qid+'-0-label');
jQuery(".SingleAnswer").click(function() {
for (var i=0;i<=11;i++){
jQuery("td:eq(" + i +")").find('label').css("background-color", "rgba(0,0,0,.06)");
jQuery("td:eq(" + i +")").find('label span').css("color", "#0000ff");}
var selected = jQuery(this).text();
for (var i=0;i<=selected;i++){
if((i==0)||(i==1)||(i==2)||(i==3)||(i==4)||(i==5)||(i==6)||(i==7)){
jQuery("td:eq(" + i +")").find('label').css("background-color", "rgb(255,0,0)");
}
if((i==8)||(i==9))
{
jQuery("td:eq(" + i +")").find('label').css("background-color", "rgb(255,165,0)");
jQuery("td:eq(" + i +")").find('label span').css("color", "#ff0000")}
if((i==10)||(i==11))
{
jQuery("td:eq(" + i +")").find('label').css("background-color", "rgb(60,179,113)");
jQuery("td:eq(" + i +")").find('label span').css("color", "#ff0000")}
}
})
});
Thanks in Advance.