-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
53 lines (48 loc) · 1.81 KB
/
script.js
File metadata and controls
53 lines (48 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Sample data for categories and top businesses
const categories = ['Restaurants', 'Real Estate', 'Schools', 'Clinics', 'Law Firms'];
const topFoodBusinesses = ['Restaurant A', 'Restaurant B', 'Restaurant C'];
const topSchools = ['School A', 'School B', 'School C'];
const topRealEstateAgents = ['Agent A', 'Agent B', 'Agent C'];
// Function to populate categories
function populateCategories() {
const categoryList = document.getElementById('categoryList');
categories.forEach(category => {
const li = document.createElement('li');
li.textContent = category;
categoryList.appendChild(li);
});
}
// Function to populate top food businesses
function populateTopFood() {
const topFoodList = document.getElementById('topFoodList');
topFoodBusinesses.forEach(business => {
const li = document.createElement('li');
li.textContent = business;
topFoodList.appendChild(li);
});
}
// Function to populate top schools
function populateTopSchools() {
const topSchoolsList = document.getElementById('topSchoolsList');
topSchools.forEach(school => {
const li = document.createElement('li');
li.textContent = school;
topSchoolsList.appendChild(li);
});
}
// Function to populate top real estate agents
function populateTopRealEstate() {
const topRealEstateList = document.getElementById('topRealEstateList');
topRealEstateAgents.forEach(agent => {
const li = document.createElement('li');
li.textContent = agent;
topRealEstateList.appendChild(li);
});
}
// Call functions to populate data on page load
document.addEventListener('DOMContentLoaded', () => {
populateCategories();
populateTopFood();
populateTopSchools();
populateTopRealEstate();
});