The New HTML5 Datalist Element
The HTML5 <datalist> element specifies a list
of pre-defined options for an <input>
element and it works like an “autocomplete” feature for users:
And the output will be:
The <datalist>
tag is currently supported in Firefox and Opera. We can just hope that other browsers will
soon support this great feature.
Published at DZone with permission of its author, Constantin Alin. (source)<!DOCTYPE html> <html> <body> <form action="login.php" method="post"> User: <input list="username" name="username" /> <datalist id="username"> <option value="Aaron"> <option value="Rafael"> <option value="Cale"> <option value="Eddie"> <option value="Valentin"> </datalist> Password: <input type="password" /> <input type="submit" value="Login" /> </form> </body> </html>
And the output will be:
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)
Tags:




