let input = document.querySelector('input'); input.addEventListener('input', async function() { //swap out for endpoint let response = await fetch('/search?q=' + input.value); let jsonReturnedValues = await response.json(); let html = ''; for (let i in jsonReturnedValues){ // save outputty things for each instance to the html var } document.querySelector('div').innerHTML = html; });Modified from the clean ajax example in Lecture 9 of CS50