BHHS B.A.C Property Search

BHHS B.A.C Property Search

async function fetchBlogs() { try { const response = await fetch('your_api_endpoint'); const blogs = await response.json(); return blogs; } catch (error) { console.error('Error fetching blogs:', error); } } async function searchProperties() { const query = document.getElementById('search-input').value.toLowerCase(); const criteria = document.getElementById('search-criteria').value; const resultsContainer = document.getElementById('results'); resultsContainer.innerHTML = ''; const blogs = await fetchBlogs(); const blogDiv = document.createElement('div'); blogDiv.className = 'result-item'; blogDiv.innerHTML = `

${blog.title}

${blog.content}

Location: ${blog.location}

Price: $${blog.price}

Commission: ${blog.commission}

MLS ID: ${blog.mls_id}

Beds: ${blog.bed}

Baths: ${blog.bath}

Agent: ${blog.agent_name}

`; resultsContainer.appendChild(blogDiv); }); } else { resultsContainer.innerHTML = '

No results found

'; } }