<label for="planet">Which planet are you from?</label>
<input id="planet" type="text" list="superhero" />
<datalist id="superhero">
<option value="Azarath"></option>
<option value="Krypton"></option>
<option value="Tamaran"></option>
</datalist>HTMLInputElement: list property / notebook
HTMLInputElement: list property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const inputElement = document.querySelector("#planet");
console.log(inputElement.list); // returns the superhero HTMLDatalistElement