How to add Hover Text/Tooltip to multiple choice drop down choices | XM Community
Skip to main content
Question

How to add Hover Text/Tooltip to multiple choice drop down choices

  • September 14, 2023
  • 5 replies
  • 1548 views

Ashlee_C
Forum|alt.badge.img+1

I am looking for a way to add Hover Text/Tooltip to multiple choice drop down choices..

 

I was able to use this resource to add it to a list format multiple choice question, which worked perfect, but when I do a drop down format, I do not get the option for the “Rich Content Editor” for the choices like I do with the list format. The “Rich Content Editor” is where I put in some coding to create the hover text. I even tried just changing the format on the question after adding the hover text to drop down, but the hover text then doesn’t work.

 

Any guidance is much appreciated!

5 replies

Rishabh_Singh05
QPN Level 2 ●●
Forum|alt.badge.img+9

Hi Ashlee,

We can only add the hover option over something we can use as a part of the Rich Content Editor, since we do not have that option for dropdown, I do not believe we have a way to get this done.


Forum|alt.badge.img+1

Some time hover doesn't work on mobile devices.

Instead of hover you can use the pop up box in click of perticular text.


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5868 replies
  • September 14, 2023

@Ashlee_C,

You can’t have html within a select option, so the method used in the tooltip link you provided won’t work. Also, any html you add to choice labels will be stripped out by Qualtrics if you use a dropdown.

You can add a ‘title’ attribute to the options with JavaScript and they will display on hover.

 


Ashlee_C
Forum|alt.badge.img+1
  • Author
  • 1 reply
  • September 14, 2023

@TomG Thanks for this - after reading your comment I am trying to find a resource to reference on how to add a ‘title’ attribute to the options with JavaScript - can you point me anywhere to find steps/a how to?


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5868 replies
  • September 14, 2023
Ashlee_C wrote:

@TomG Thanks for this - after reading your comment I am trying to find a resource to reference on how to add a ‘title’ attribute to the options with JavaScript - can you point me anywhere to find steps/a how to?

You can do it like this:

Qualtrics.SurveyEngine.addOnload(function() {
	var titles = [
		"",
		"choice 1 tooltip",
		"choice 2 tooltip",
		"choice 3 tooltip"
	];
	jQuery("#"+this.questionId+" select option").each(function(i) { this.setAttribute("title",titles[i]); });
});

 


Leave a Reply