title: Select first element of dropdown of an input box
body: <p>I have an input box </p>
  
  <pre><code>&lt;input id="source" onchange="openDropdown(...)" &gt;
  </code></pre>
  
  <p>Whenever I enter any text inside this input box a dropdown of suggestion appears. Now I want to automatically select the first suggestion using JavaScript, but can't find any way to do this.
  REQUIREMENT: You need to only use input id to select the first suggestion. I don't know the onchange function.</p>
  
  <blockquote>
    <p>NOTE:- I am not having any select element here.I am just having an
    input element here.So the thing is that i just want to select the
    first element in the dropdown which will open after we start typing in
    that input box(&amp; i don't know how this dropdown is coming.I just know
    that some input box is there.)I am not having the full code.</p>
  </blockquote>