Survey Platform - Add JavaScript | Qualtrics

Add JavaScript

Warning: Custom coding features are provided as-is and may require programming knowledge to implement. Our support team does not offer assistance or consultation on custom coding. If you’d like to know more about our custom coding services, please contact your Qualtrics Account Executive.


JavaScript is a programming language that enables you to accomplish more advanced functionality in your survey than would otherwise be available. For example, you can change the size of a question text box, create a custom question type, and much more.

Qtip: Learn the basics of JavaScript through a series of simple and free tutorials at

Accessing the JavaScript Editor

  1. Navigate to the Survey module and select the question you want to add JavaScript to.image04
  2. Click the gray gear to the left of the question and select Add JavaScript.image00
  3. Place your JavaScript in the box, below the /*Place Your JavaScript Below This Line*/ text. The opening and closing tags are already provided (do not delete them).image02
  4. Click Save.java03
  5. To preview the changes you have made, click Preview Survey on the main bar. Note the orange icon next to the question; this icon indicates that the question has custom JavaScript on it.image06
  6. To remove your JavaScript, open the editor, click Clear, and then click Save.image05
Qtip: There are several special functions from the Qualtrics code library that can be used in your custom JavaScript. Documentation on these functions is found on our JavaScript API.