HTML, CSS, JavaScript
Main goal -> Search + autocomplete data from api and custom html component without frameworks.
const query = event.target.value;
const options = {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json',
Accept: 'application/json',
Authorization: 'Token ' + token,
},
body: JSON.stringify({ query }),
};
fetch(url, options)
.then((response) => response.json())
.then((result) => {
renderResults(result);
nameInput.focus();
})
.catch((error) => console.log('error', error));
};
git clone https://github.com/cold-world/autocomplete-from-api.git