Question T6659
Visible to All Users

customize survey js tooltip

created 4 years ago (modified 4 years ago)

Hello Survey JS team,

We are using survey js and trying to customize the tooltip.

Page:
Question:
''html'
"title": 'this is a question'
"tooltip":{
"default": 'this is English tooltip<ul style='list-style: none;'><li>-item1</li><li>-item2</li>'
"fr": 'this is French tooltip<ul style='list-style: none;'><li>-item1</li><li>-item2</li>'
}

Essentially, we would like to add html into the help text and want to show the text only (hide the html) when havering over.

Is there a solution to this?

Thanks

Fan

Answers approved by surveyjs Support

created 4 years ago

Hello Fan,
You can use after render example as a base template.
Instead of adding a button, in this example, you will need to set title attribute to a header tag, <h5/>.

Thank you,
Andrew
SurveyJS Team

    Comments (3)

      This part is already done.

      Now we would like to customize the tooltip message and apply html to this tooltip message as shown in the above example.

      For example:

      we would like to see

      "this is English tooltip
      -item 1
      -item 2"

      as the hovering over tooltip instead of "this is English tooltip<ul style='list-style: none;'><li>-item1</li><li>-item2</li>"

      Thanks

        We do not have this functionality. You have to find a library that can render tooltip as html. I believe there are plenty of them for all popular JavaScript platforms. You can choose that suites you best.

        Thank you,
        Andrew
        SurveyJS Team

          Hey Andrew,

          we are using version '1.8.21'

          That might have been the problem and I will take a look

          If further help needed, I will come back,

          Thanks a lot for the current help,

          Fan