Skip to content
Advertisement

display ajax information under input field

I tried to develop an ajax to display some information. My ajax works fine but it do not display the information under the input field. Do you have any idea to resolve that ?

thank you.

JavaScript

my ajax request called across the input field, I use to display information:

JavaScript

example of response I can see on sa keywords:

JavaScript

Advertisement

Answer

You are appending new options inside input but you need to append it inside datalist .Also , option.value = item.name will give you result has [Object object] that’s why you need to specify field i.e : id ,name to access same elements . i.e : item.name .

Demo Code :

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement