Accessibility Compliance
SurveyJS libraries meet a variety of WCAG and Section 508 standards. Run AXE® Validation to assess this demo’s accessibility level.

Change Survey HTML with JavaScript

Edit in →

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.

Your cookie settings

We use cookies to make your browsing experience more convenient and personal. Some cookies are essential, while others help us analyse traffic. Your personal data and cookies may be used for ad personalization. By clicking “Accept All”, you consent to the use of all cookies as described in our Terms of Use and Privacy Statement. You can manage your preferences in “Cookie settings.”

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.