Hi,
I want to use JavaScript to show conditional question text depending on respondent's age.
I searched Qualtrics help and found the below code which is working fine and showing conditional question text. But question text and respondent probe are show in one line. Is there any way the the respondent probe "Please select ONE." can be shown below the question in a separate line and appear in italics?
Qualtrics.SurveyEngine.addOnReady(function () {
var Age = parseInt("${q://QID2/ChoiceTextEntryValue}")
qc = this.getQuestionContainer().querySelector(".QuestionText");
if (Age > 15 && Age < 20) {
qc.innerText = "Are you currently at high school or studying a course? Please select ONE.";
} else {
qc.innerText = "Are you currently also studying a course? Please select ONE.";
}
});
Thanks for your help!
Be the first to reply!
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.