Bike Search
The goal of this coding exam is to quickly get you off the ground with HTML search input element and Bootstrap spinner
Use the below reference image.
https://assets.ccbp.in/frontend/content/dynamic-webapps/bike-search-op.gif
Instructions
Add the id searchInput to the HTML input element
Achieve the design with HTML, CSS, and functionality with JS
let request = fetch(`https://apis.ccbp.in/city-bikes?bike_name=${val}`)
.then((response) => {
return response.json();
})
.then((data) => {
let res = '';
data.map(item => {
res += `
<div class="item">
<p class="title">Bike name: ${item.name}</p>
<p class="desc">City: ${item.city}</p>
</div>
`;
})
spinner.classList.add('hidden');
content.innerHTML = res;
content.classList.remove('hidden');
});
Comments
Leave a comment