Change Survey HTML with JavaScript

Edit in →

SurveyJS Form Library allows you to modify HTML markup of individual survey elements. This demo shows how to add tooltips to question titles. Hover the mouse pointer over a question title to see its tooltip. Read more...

Themes
Color palette
Question appearance
Sorry, we can't retrieve the data from server. Please comeback later.

SurveyJS Form Library offers multiple customization options for survey elements (panels and questions):

  • Configure templates for answer options in single- and multi-select questions (View Demo)
  • Implement custom question renderers based on built-in question types (View Demo)
  • Create custom question types (View Demo)

If none of these options meets your requirements, you can handle events to modify HTML markup of individual survey elements. The SurveyModel class raises the following events for this purpose:

Each of these events accepts the options.htmlElement parameter, which contains an HTMLElement object. You can use its properties and methods to change HTML markup in your JavaScript code. For example, this demo shows how to add tooltips to question titles. Tooltip texts are specified in a question's title property and are separated from the title text by a special character combination ("||"). The onAfterRenderQuestion event handler splits the title property value and assigns title text to HTMLElement's innerText property and the tooltip text to HTMLElement's title property. Hover the mouse pointer over a question title to see its tooltip.

Why we use cookies.

This site uses cookies to make your browsing experience more convenient and personal. Cookies store useful information on your computer to help us improve the efficiency and relevance of our site for you. In some cases, they are essential to making the site work properly. By accessing this site, you consent to the use of cookies.

For more information, refer to DevSoft Baltic’ Terms of Use & Privacy Statement.

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.