Hello. I have the following task. It is necessary with the help and jquery to implement search in xml. So that when a person begins to enter text into an input, right here, in the drop-down list under the input, the necessary options are displayed. Objects in xml have a name (title) and a link (url). Accordingly, so that in the issue there was only the name of the object and when clicking on it there was a transition to the corresponding url.

Sorry if I explained intricately, I will answer all questions and provide the code if needed. I would be very grateful for the help.

    1 answer 1

    Something like this, if you do not see the code. But the principle should be clear

    var parser = new DOMParser(), xmlDoc = parser.parseFromString(ajaxResponse,"text/xml"); var url = xmlDoc.getElementsByTagName("url")[0].childNodes[0].nodeValue