<h1>Datalist Element</h1>
  <div class="field">
  <label for="default">Pick a programming language</label>
  <input type="text" id="default" list="languages" placeholder="e.g. JavaScript">
  <datalist id="languages">
    <option value="HTML">
    <option value="CSS">
    <option value="JavaScript">
    <option value="Java">
    <option value="Ruby">
    <option value="PHP">
    <option value="Go">
    <option value="Typescript">
    <option value="Python">
    <option value="C">
    <option value="C#">
    <option value="C++">
  <p>You can type in the input and it will autocomplete the list for you</p>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

.field {
 display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 32px 0 0 0;

label {
  color: #555;

p {
  color: #888;
  font-size: 12px;
input {
   width: 100%;
  padding: 0.5em 0.5em;
  font-size: 1.2em;
  border-radius: 3px;
  border: 1px solid #D9D9D9;
  font-family: 'Poppins', sans-serif;

body {
  margin: 30px auto;
  display: flex;
  justify-items: center;
  max-width: 500px;
  font-family: 'Poppins', sans-serif;
  height: 100vh;
  background: linear-gradient(68.6deg, rgb(252, 165, 241) 1.8%, rgb(181, 255, 255) 100.5%);
main {
  width: 100%;

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.