Access the Question Name From JavaScript | XM Community
Skip to main content
Solved

Access the Question Name From JavaScript

  • September 3, 2020
  • 2 replies
  • 153 views

Hi- How do you access a question's name from JS? (eg the text that defaults to 'Q1' in the Survey admin UI, but that you can change to whatever you want). I tried getQuestionInfo() but it's not there.

Thanks

Best answer by rondev

Use the below code: (make sure you have checked 'Show Question Numbers' option under survey option)
var s = jQuery("#"+this.questionId+" .ExportTag").text();

2 replies

rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • Answer
  • September 3, 2020

Use the below code: (make sure you have checked 'Show Question Numbers' option under survey option)
var s = jQuery("#"+this.questionId+" .ExportTag").text();


  • Author
  • September 3, 2020

Perfect. Thank you.