The HTML Data List element - Dropdown with filtering without any CSS/JS

Today I learned that there is support for having in input that filters a list without any need for JavaScript.

<label for="myBrowser">Choose a browser from this list:
</label>
<input list="browsers" id="myBrowser" name="myBrowser" />
<datalist id="browsers">
  <option value="Chrome">
  <option value="Firefox">
  <option value="Internet Explorer">
  <option value="Opera">
  <option value="Safari">
  <option value="Microsoft Edge">
</datalist>

Checkout the Demo on CodePen.

Comments

No comments

It's a bit quiet here. Why not be the first to post something?

Subscribe to our newsletter

No spam. Just simple and infrequent platform updates when something big happens.

© 2021 TechTalks.io Limited. All rights reserved.