Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<form>
  <input list="browsers" name="browser">
  <datalist id="browsers">
    <option value="Internet Explorer">
    <option value="Firefox">
    <option value="Chrome">
    <option value="Opera">
    <option value="Safari">
  </datalist>
</form>
<p>Click the button to display the value of all the option elements in the datalist.</p>
<button type="button" onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
  var x = document.getElementById("browsers");
  var txt = "";
  var i;
  for (i = 0; i < x.options.length; i++) {
    txt = txt + x.options[i].value + "<br>";
  }
  
  document.getElementById("demo").innerHTML = txt;
}
</script>
</body>
</html>