generated from alchemycodelab/dev-101-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
23 lines (19 loc) · 777 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* eslint-disable no-console */
// grab DOM elements
// set event listeners
const nameDisplay = document.getElementById('name');
console.log(nameDisplay);
const updateBtn = document.getElementById('update-btn');
updateBtn.addEventListener('click', () => {
console.log('i am clicking the button');
const nameInput = document.getElementById('name-input');
nameDisplay.textContent = nameInput.value;
});
const locationName = document.getElementById('location');
console.log(locationName);
const updateBtn2 = document.getElementById('update-btn2');
updateBtn2.addEventListener('click', () => {
console.log('i am clicking the button');
const locationInput = document.getElementById ('location-input');
locationName.textContent = locationInput.value;
});