How can I add a header to the right statement/answer for a max diff | XM Community
Skip to main content

How can I add a header to the right statement/answer for a max diff? Currently, I can only do it for the left answer using this:
jQuery("#"+this.questionId+" td.c1:first").html("Statement A");
jQuery("#"+this.questionId+" td.AnswerLeft").html("Statement B");

I can't figure out how to do the same for the right side and the text has to be in line with the column headers

ex1.PNG

Use the below code,
jQuery('tbody tr:eq(0)').find('td:last-child').after('Statement B')


Thanks!! However, the new label isn't aligned with statement B. Instead, it looks like it's part of a new empty column.

For now I have just included the labels as part of the question text but this is also not an ideal layout

image.png


For a bipolar matrix:
jQuery("#"+this.questionId+" tr.ColumnLabelHeader").append("Statement B");


TomG Thanks for your help!
It looks like it did work but it'd also adding text to the radio buttons. Is there a way to hide these?
image.png


It looks like it did work but it'd also adding text to the radio buttons.

That text must be from something else you've done.


Try to add one more td before the actual statement, like this,
jQuery('tbody tr:eq(0)').find('td:last-child').after('Statement B')


SurajK this last one worked!! thanks 😊
image.png


Leave a Reply