<!DOCTYPE html>
<
html
>
<
head
>
<
title
> HTML DOM Input search list property </
title
>
</
head
>
<
body
style
=
"text-align:center"
>
<
h1
style
=
"color:green"
>
GeeksforGeeks
</
h1
>
<
h2
>DOM Input search list property</
h2
>
<
label
>Search anything: </
label
>
<
input
type
=
"search"
list
=
"Hello Geeks"
id
=
"search_id"
value
=
"GeeksforGeeks"
>
<
datalist
id
=
"Hello Geeks"
>
<
option
value
=
"Google"
/>
<
option
value
=
"amazon"
/>
<
option
value
=
"flipkart"
/>
<
option
value
=
"Twitter"
/>
<
option
value
=
"Facebook"
/>
</
datalist
><
br
><
br
>
<
button
onclick
=
"btnclick()"
>Click Here!</
button
>
<
p
id
=
"paraID"
style
=
"font-size:20px"
></
p
>
<
script
>
function btnclick() {
var txt = document.getElementById("search_id").list.id;
document.getElementById("paraID").innerHTML = txt;
}
</
script
>
</
body
>
</
html
>