Тег <datalist></datalist>



Этот тег определяет список вариантов.




index.html
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  • </head>
  • <body>
  •  <p>Enter a month of the year</p>
  •  <input type="text" list="months" />
  •  <datalist id="months">
  •   <option value="January">January</option>
  •   <option value="February">February</option>
  •   <option value="March">March</option>
  •   <option value="April">April</option>
  •   <option value="May">May</option>
  •   <option value="June">June</option>
  •   <option value="July">July</option>
  •   <option value="August">August</option>
  •   <option value="September">September</option>
  •   <option value="October">October</option>
  •   <option value="November">November</option>
  •   <option value="December">December</option>
  •  </datalist>
  • </body>
  • </html>
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  • </head>
  • <body>
  •  <p>Enter a month of the year</p>
  •  <input type="text" list="months" />
  •  <datalist id="months">
  •   <option value="January">January</option>
  •   <option value="February">February</option>
  •   <option value="March">March</option>
  •   <option value="April">April</option>
  •   <option value="May">May</option>
  •   <option value="June">June</option>
  •   <option value="July">July</option>
  •   <option value="August">August</option>
  •   <option value="September">September</option>
  •   <option value="October">October</option>
  •   <option value="November">November</option>
  •   <option value="December">December</option>
  •  </datalist>
  • </body>
  • </html>