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:
<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">

Checkout the Demo on CodePen.


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.

© 2023 Limited. All rights reserved.