title: datalist how to tell if input is one of the options
body: <p>I was wondering why why I select 2 with a select tag it returns true in the console. But Whenever I select 2 in the datalist it returns false in the console. </p>
  
  <p>In short I need the datalist to return tru. I need to it be true so that when the user enters in the input I can ensure that the user has enter in a option I wanted (one of the drop down menu options ) </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function castvote() {
      var selected = document.getElementById('vote');
      console.log("Chrome" in selected);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>  &lt;input list="vote" onchange="castvote()" id="voteInput"&gt;
    &lt;datalist id="vote" &gt;
      &lt;option value="Chrome"&gt;
    &lt;/datalist&gt;
  
  &lt;label&gt;Choose a browser from this list:
      &lt;input id = "a" list="browsers" name="myBrowser" 
        style="width: 400px;" onclick="test()" /&gt;&lt;/label&gt;
    &lt;datalist id="browsers"&gt;
      &lt;option value="Chrome"&gt;
      &lt;option value="Firefox"&gt;
      &lt;option value="Internet Explorer"&gt;
      &lt;option value="Opera"&gt;
      &lt;option value="Safari"&gt;
      &lt;option value="Microsoft Edge"&gt;
    &lt;/datalist&gt;</code></pre>
  </div>
  </div>
  </p>