Use markdown to render images in title and question elements
Open in new window

SurveyJS supports markdown via onTextMarkDown event. You may use any JavaScript markdown library. In this example, we are using Showdown markdown. You may use all features that this or other libraries have.

Survey.Survey.cssType = "bootstrap";
Survey.defaultBootstrapCss.navigationButton = "btn btn-green";

window.survey = new Survey.Model({ questions: [ 
    { type: "radiogroup", hasOther: true, isRequired: true, name: "favoritePet",
     title: "What is your favorite pet ![A parrot]( =16x16) ?",
   choices: [ 
       { value: "dog", text: "Dog: ![A dog]( =14x14)" }, 
       {value: "cat", text: "Cat: ![A cat]( =14x14)"}, 
       {value: "parrot",text: "Parrot ![A parrot]( =14x14)"} ]}
survey.onComplete.add(function(result) {
	document.querySelector('#surveyResult').innerHTML = "result: " + JSON.stringify(;

//Create showdown mardown converter
var converter = new showdown.Converter();
survey.onTextMarkdown.add(function(survey, options){
    //convert the mardown text to html
    var str = converter.makeHtml(options.text);
    //remove root paragraphs <p></p>
    str = str.substring(3);
    str = str.substring(0, str.length - 4);
    //set html
    options.html = str;

ReactDOM.render(<Survey.Survey model={survey} />, document.getElementById("surveyElement"));

<!DOCTYPE html>

    <title>Welcome to React</title>
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <link rel="stylesheet" href="">
    <link rel="stylesheet" href="./index.css">

    <div id="surveyElement"></div>
    <div id="surveyResult"></div>
    <script type="text/babel" src="./index.js"></script>


.btn-green {
  background-color: #1ab394;
  color: #fff;
  border-radius: 3px;

.btn-green:hover, .btn-green:focus {
    background-color: #18a689;
    color: #fff;

.panel-footer {
    text-align: right;
    background-color: #fff;