title: How to get the id value in data-list on change the values?
body: <p>Here i am using data-list,bangalore is default selected so that time i can get the id value but when ever change values i am not able to get id values like suppose user want change insteed of bangalore , that time i want to take the value , how can do this ?</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>var city_id = $('#cities option[value="' + $('#cityName').val() + '"]').data('id');
      console.log(city_id);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;input list="cities" value="Bangalore" class="form-control cities" name="cityName" id="cityName" style="border-radius:0px;height: 36px;"&gt;
  &lt;datalist id="cities"&gt;
  &lt;option data-id="1" value="Bangalore"&gt;
   &lt;option data-id="2" value="Chennai"&gt;
  &lt;option data-id="3" value="Trichy"&gt;
  &lt;/datalist&gt;</code></pre>
  </div>
  </div>
  </p>