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

Access the Question Name From JavaScript

  • Sep 3, 2020 5:05 PM UTC
  • 2 replies
  • 186 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();

View original

2 replies

rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • Answer
  • Sep 3, 2020 5:41 PM UTC

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


  • Author
  • Sep 3, 2020 8:04 PM UTC

Perfect. Thank you.