Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

I want to give alternate colouring to single select respondes

Hi all,

I want to colour the response options into alternate colouring for a single select question but couldnt find any way to do so.

I can only colour the grid questions.

Is there a way to do that ?
asked Jun 29, 2018 by Hitesh_Kalwani Bronze (540 points)

1 Answer

+2 votes
Best answer
Placing this script in your select question should add alternating colors to a select question:

    var responseRows = $('#[% QuestionName() %]_div .response_row');
    for (var i = 0; i < responseRows.length; i++) {
        if (i % 2) {
            $(responseRows).eq(i).css('background-color', 'blue');
        else {
            $(responseRows).eq(i).css('background-color', 'green');

The "blue" and "green" can be replaced with any CSS colors.
answered Jun 29, 2018 by Zachary Platinum Sawtooth Software, Inc. (111,375 points)
selected Jul 13, 2018 by Hitesh_Kalwani
Thanks a lot.. this worked :)