generated from alchemycodelab/dev-101-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
33 lines (24 loc) · 1009 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
24
25
26
27
28
29
30
31
32
33
// DOM - document object model
// built into your browser -- its a JS representation of your HTML
// DOM GETTER METHODS
// getElementById
const nameDisplay = document.getElementById('name-display');
console.log(nameDisplay);
// DOM SETTER METHODS
// textContent
nameDisplay.textContent = 'Andres';
nameDisplay.classList.add('purple');
const updateBtn = document.getElementById('update-button');
updateBtn.addEventListener('click', () => {
console.log('i am clicking the button');
const foodInput = document.getElementById('food-input');
foodDisplay.textContent = foodInput.value;
const nameDisplay = document.getElementById('food-display');
console.log(foodDisplay);
foodDisplay.textContent = 'Ramen';
const updateBtn = document.getElementById('nomNomNom-button');
updateBtn.addEventListener('click', () => {
console.log('i am clicking the button');
const foodInput = document.getElementById(food-input);
foodDisplay.textContent = foodInput.value;
});