Today I Learned - Rocky Kev

TIL Input List with datalist

POSTED ON:

TAGS:

The tag is used to provide an "autocomplete" feature for elements. You will see a drop-down list of pre-defined options as you type.

<label>Selector:
<input list="animals" name="animal" id="animal">
</label>

<datalist id="animals">
<option value="Cat">
<option value="Dog">
<option value="Chicken">
<option value="Cow">
<option value="Pig">
</datalist>

See the Pen Input Selector by rockykev (@rockykev) on CodePen.

via
https://javascript.plainenglish.io/11-frontend-tricks-that-most-frontend-developers-dont-know-about-68dc48199ed6


Related TILs

Tagged:

TIL Gmail has a 102KB size-limit for HTML

PLACEHOLDER

TIL how Error correction works in HTML

You never get an 'Invalid Syntax' error on an HTML page. Browsers fix any invalid content and go on.

TIL what DOCTYPE means

tl;dr: DOCTYPE declaration in the first line of the HTML file, to instruct the browser to run the code in Standard mode.