Today I Learned
Search…
Auto-complete in plain HTML
You can make a type-ahead/autocomplete like thing in plain HTML using the <datalist></datalist> tag.

Usage

1
<!DOCTYPE html>
2
<html>
3
<head>
4
<title></title>
5
</head>
6
<body>
7
<h1>Type Ahead HTML</h1>
8
<input list="test" placeholder="Choose an option">
9
<datalist id="test">
10
<option value="C++">
11
<option value="Python">
12
<option value="Go">
13
<option value="JavaScript">
14
<option value="HTML">
15
</datalist>
16
</body>
17
</html>
Copied!
Now as you type G it will show Go ;)

Resources

Copy link
Edit on GitHub