Preview
How to Display Suggestions for Input Field in HTML ?
In most cases, there is a field on forms that allows for auto-completion of user input. This can be achieved using the HTML <datalist>. The <datalist> tag works with the input tag to enable users to quickly fill in data on forms by presenting them with a dropdown list of pre-defined options. In this article, we will explain how to create an input suggestion form using HTML and CSS, and demonstrate how to use the <datalist> tag to enable the auto-completion feature on your website.
Note: The element’s id attribute used in the <datalist> tag should be equal to the element’s list attribute in the <input> tag which will help to bind them together.