Custom widget: Select2

Select2 Widget Third-party libraries: Select2 MIT



var json = {
  "elements": [
      "type": "dropdown",
      "renderAs": "select2",
      "choicesByUrl": {
        "url": ""
      "name": "countries",
      "title": "Please select the country you have arrived from:"

window.survey = new Survey.Model(json);

    survey.onComplete.add(function(result) {
        document.querySelector('#surveyResult').textContent =
            "Result JSON:\n" + JSON.stringify(, null, 3);
    }); = { countries: 'Andorra' };


<!DOCTYPE html>
    <title>Select2 Widget, Knockoutjs Survey Library Example</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src=""></script>
    <script src=""></script>
<script src=""></script>
<link href="" type="text/css" rel="stylesheet" />
    <link rel="stylesheet" href="./index.css">
<script src=""></script>
<link href="" rel="stylesheet" />
    <script src=""></script>

                <div id="surveyElement">
    <div id="surveyResult"></div>

<script type="text/javascript" src="./index.js"></script>