<!DOCTYPE html>
<
html
>
<
head
>
<
title
>DOM Input URL list Property</
title
>
</
head
>
<
body
>
<
center
>
<
h1
style
=
"color:green;"
>
GeeksforGeeks
</
h1
>
<
h2
>DOM Input URL list Property </
h2
>
<
label
for
=
"uname"
style
=
"color:green"
>
<
b
>Enter URL</
b
>
</
label
>
<
input
type
=
"url"
id
=
"inputID"
list
=
"url_list"
placeholder
=
"Enter URL"
>
<
datalist
id
=
"url_list"
>
<
option
value
=
"Google.com"
/>
<
option
value
=
"amazon.com"
/>
<
option
value
=
"flipkart.com"
/>
<
option
value
=
"Twitter.com"
/>
<
option
value
=
"Facebook.com"
/>
</
datalist
><
br
>
<
br
><
br
>
<
button
type
=
"button"
onclick
=
"btnclick()"
>
Click Here!
</
button
>
<
p
id
=
"paraID"
style
=
"color:green;font-size:20px;"
> </
p
>
<
script
>
function btnclick() {
// Return the Input URL list property.
var link = document.getElementById("inputID").list.id;
document.getElementById("paraID").innerHTML = link;
}
</
script
>
</
center
>
</
body
>
</
html
>