title: Set value of Select option in Javascript
body: <p>Is there any function to set value of a <code>&lt;select&gt;</code> tag option? I have an ajax response array and I want to put this array in a <code>&lt;select&gt;</code> tag.</p>
  
  <p>This is my code : </p>
  
  <pre><code>$.ajax({
      type: "GET",
      url: "http://.......api/1/AbsenceType",
      dataType: "json", 
      success: function (data) {
          // It doesn't work
          var ind = document.getElementById('mySelect').selectedIndex;
          document.getElementById('mySelect').options.value="2";//
      }
  })
  </code></pre>
  
  <p>And my select tag is : </p>
  
  <pre><code>&lt;select id=mySelect name="mySelect" required="required" data-mini ="true" onchange="myFunction3();"/&gt;
      &lt;option id ="type" value=""&gt;&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>