Add Static Text to DropDown Menu | XM Community
Skip to main content

Add Static Text to DropDown Menu

  • August 1, 2022
  • 0 replies
  • 98 views

Forum|alt.badge.img+1

Hello,
I'd like to add static text to a multiple choice/drop down menu question.
I have code to do this with a text entry, but I'm not sure if this can be edited for a drop down menu.
Any help is greatly appreciated, thank you!

This is the code I have for text entry:
var inputs = $(this.getQuestionContainer()).select('input[type="text"]');

for (var i = 0; i < inputs.length; i++) {
  var input = inputs[i];
  $(input).insert({before: '$ '});
  $(input).insert({after: ' spent in the past 12 months'});
}