title: Double click on the selected item in dropdown
body: <p>I am having problem that as i select an item from drop-down the list box does not comes i need to click again on the selected item item in drop-down to get the list appear..that means i need a double click on the item in drop-down.
  This is my html</p>
  
  <pre><code> &lt;script&gt;
      function ShowHideListBox(e) {
          e.stopPropagation()
          e.preventDefault()
  
          var IsOpen = $('#listbox').attr('IsOpen')
          if (IsOpen == "false") {
              ShowList(e)
          }
          else {
              HideList(e)
          }
      }
  
      function ShowList(elem) {
          $('#listbox').attr('IsOpen', 'true')
          $('#listbox').show()
      }
  
      function HideList(elem) {
          $('#listbox').attr('IsOpen', 'false')
          $('#listbox').hide()
      }
  
  &lt;/script&gt;
  &lt;form name="myform" id="myForm"&gt;
          &lt;select id="dropdown1" onclick="return ShowHideListBox(event)"&gt;&lt;/select&gt;
  
  
          &lt;select id="listbox" multiple style="display:none; cursor:default;" isopen="false"&gt;&lt;/select&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>My js file</p>
  
  <pre><code>$(document).ready(function() {
      $.ajax({
          url: "data.json",
          dataType: "json",
          success: function(obj) {
              var jsObject = obj;
              var usedNames = [];
  
  
  
              $('&lt;option&gt;', {
                  text: 'Select your Option',
                  value: '',
                  selected: 'selected',
                  disabled: 'disabled'
              }).appendTo('#dropdown1');
  
  
              $.each(obj, function(key, value) {
                  if (usedNames.indexOf(value.name) == -1) {
                      $("#dropdown1").append("&lt;option value=" + key + "&gt;" + value.name + "&lt;/option&gt;");
                      usedNames.push(value.name);
                  }
                  /*  $('&lt;option&gt;', {
                   text: 'Select your Option',
                   value: '',
                   selected: 'selected',
                   disabled: 'disabled'
                   }).appendTo('#dropdown1');
                   */
  
                  //$.each(usedNames, function(index, value) {
                  //    $('&lt;option&gt;', {
                  //        text: value['name'],
                  //        value: index
                  //    }).appendTo('#dropdown1');
                  //});
  
                  /*    $('&lt;option&gt;', {
                   text: 'Select your List Option',
                   value: '',
                   selected: 'selected',
                   disabled: 'disabled'
                   }).appendTo('#listbox'); */
  
  
                  $('#dropdown1').change(function() {
                      $('#listbox').empty();
  
                      $('&lt;option&gt;', {
                          text: 'Select your List Option',
                          value: '',
                          selected: 'selected',
                          disabled: 'disabled'
                      }).appendTo('#listbox');
  
                      var selection = $('#dropdown1 :selected').text();
                   //   var selection = $('#dropdown1 :selected').text();
                      $.each(jsObject, function(index, value) {
                          if (value['name'] == selection) {
                              var optionHtml = '';
                              for (var i = 1; i &lt;= 20; i++) {
                                  var attr = 'attr' + ('000' + i).substr(-3);
                                  optionHtml += '&lt;option value="' + attr + '"&gt;' + value[attr] + '&lt;/option&gt;';
                              }
  
                              $("#listbox").css("width","500px")
  
                              $("#listbox").css("height","300px")
                              $('#listbox').append(optionHtml); return false;
                          }
                      });
                  });
              });
          }
      });
  });
  </code></pre>