title: send javascript variable into html selector
body: <p>I'm trying to send my variable: <code>username</code> into my selector (display username in my selector) and send my variable <code>userid</code> as value in my selector.
  Can you help me ? Here is my code :</p>
  
  <pre><code>&lt;select id="mySecond" name="continent"&gt;
      &lt;option value=""&gt;-----------------&lt;/option&gt;
      &lt;option  value=""&gt;-----------------&lt;/option&gt;
      &lt;/select&gt;
  
  
  &lt;script&gt;
  
  function displayuser() {
      var x = document.getElementById("mySelect").value;
      document.getElementById("demo").innerHTML = "Mon id: " + x;
  
    $.ajax({
        url: "https://cubber.zendesk.com/api/v2/organizations/"+x+"/users.json",
        type: 'GET',
        dataType: 'json',
              contentType:'application/json',
              secure: true,
              beforeSend: function (xhr) {
                  xhr.setRequestHeader ("Authorization", "Basic " + btoa("claire.pagniez@cubber.com"));
              },
              success: function (data){
                  for (i = 0; i &lt; data.users.length; i++) {
                  console.log(data.users[i].name);
                  var username = data.users[i].name;
                  console.log(data.users[i].id);
                  var userid = data.users[i].id;
                  }
              },
    });
  }
  
  &lt;/script&gt;
  </code></pre>