title: loading options to select using jquery
body: <p>I am using JqueryAjax to load options in Select element.</p>
  
  <pre><code>&lt;div&gt;
      &lt;select id="roleType" name="roleType" 
               onclick="loadRoleTypes();"&gt;
                 &lt;option value="s"&gt;Select&lt;/option&gt;
       &lt;/select&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JqueryAjax</p>
  
  <pre><code>function loadRoleTypes()
  {           
      $('#roleType').empty().append('&lt;option&gt;select&lt;/option&gt;');        
      $.ajax({
              url: '/ci/ajaxcall/loadRoles.php',
              dataType: 'json',
              type: 'POST',
              data: {"userCode": userCode},
              success: function(response) {
                var array = response.value;
                if (array != '')
                {
                  for (i in array) {                        
                   $("#roleType").append("&lt;option&gt;"+array[i].ROLE_TYPE+"&lt;/option&gt;");
                 }
  
                }
  
              },
              error: function(x, e) {
  
              }
  
          });
  }
  </code></pre>
  
  <p>here i am getting option values as drop down when i click select element.but i cant select a particular option.how to solve this</p>