title: How to select an item just by click on it in combobox in javascript?
body: <p>My situation is i have a comb-Box which i fill with items that are integer values dynamically through javascript.</p>
  
  <p>The problem is when i click on item to select it , It is still not selected , after clicking at that item, again i need to click outside the combo box to get it selected. I don't know why ?</p>
  
  <p>My code to do so is (it's inside table) :</p>
  
  <pre><code> &lt;body onload="loadView();"&gt;
         &lt;table&gt;
           &lt;tr&gt;
               &lt;td&gt;
                 &lt;select id="mydropdown" name="mydropdown" onblur="comboItemselect(this)"&gt;&lt;/select&gt;
               &lt;/td&gt;
           &lt;/tr&gt;
         &lt;/table&gt;
      &lt;/body&gt;
  </code></pre>
  
  <p>And how i fill the item in combo is like this : </p>
  
  <pre><code>   function loadView()
              {
                  var sel = document.getElementById('mydropdown') // find the drop down
                  for (i = 1; i &lt;= 50; i++) { // loop through all elements
                      var opt = document.createElement("option"); // Create the new element
                      opt.value = i; // set the value
                      opt.text = i; // set the text
                      sel.appendChild(opt); // add it to the select
                  }
              }
  
              /*When an item is selcted from CoboBox*/
              function comboItemselect(item)
              {
                  var selectedItem = item.options[item.selectedIndex];   
                alert("selected item is : " +selectedItem);
              }
  </code></pre>
  
  <p>What i have done before in wpf or any other application was , i just clicked on the item to be selected in combobox and it was selected, but why i need to click once on the item and then again click  outside the combobox to get it selected ? 
    How to select item just by clikinng once on that combo box item</p>