Using javascript for table headings | XM Community
Skip to main content

Hi,
I am using Javascript to put headings in the top left column of the tables in my survey. I am using the code
var $jq = jQuery.noConflict();
$jq('.Headings .c1').html('write what you want');
I put this in each question's javascript and wrote what I wanted the label to say for each table. When I go to preview the individual questions on editing mode, it appears normal.
When I am taking the survey as a test run though, all the tables on the same page now show the same heading. It appears they all take the heading of the first table. How do I fix this so each table has the correct label I put into its code, and doesn't take the other one on the page?
Thanks.

Use this code:

this.questionContainer.querySelector(".Answers").firstElementChild.innerText = "Write What you want"


Thank you very much.


Leave a Reply