-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
36 lines (31 loc) · 1.29 KB
/
index.js
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
const cityApi = new CityApi('http://localhost:3000/cities')
const form = document.getElementById('restaurant-form')
const header = document.getElementById('header')
document.addEventListener('DOMContentLoaded', () => {
cityApi.getCities();
form.addEventListener('submit', restaurantApi.submitForm.bind(restaurantApi))
});
// const cityFiltDrop = document.getElementById("cityDropdown");
// cityFiltDrop.addEventListener('change', () => {
// const selectCityDropdown = document.getElementById("cityRestaurant")
// const headerCityOption = document.createElement('option');
// headerCityOption.value = this.id;
// headerCityOption.innerText = this.name;
// selectCityDropdown.append(headerCityOption);
// console.log(`${selectCityDropdown.value}`)
// });
// const cityFiltDrop = document.getElementById("cityDropdown");
// cityFiltDrop.addEventListener('change', () => {
// console.log(`${this}`)
// // var citName =
// // if (citName ==="1"){
// // console.log(`${this.name}`)
// // }else if (citName ==="2"){
// // console.log(`${this.name}`)
// // } else if (citName ==="3"){
// // console.log(`${this.name}`)
// // } else {
// // console.log(`${this.name}`)
// // }
// // return citName;
// });