-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
53 lines (28 loc) · 1.14 KB
/
script.js
File metadata and controls
53 lines (28 loc) · 1.14 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
window.onload = () => {
/* put stuff here */
console.log('hey there');
let listItem = document.getElementById('listBox');
console.log(listItem);
let list = document.getElementById('theList');
console.log(list);
let regularList = document.getElementsByClassName('regularItem');
console.log(regularList);
function clickButton () {
list.innerHTML += `<li class="checkBox">${listBox.value} <input type="checkbox"></li><br>`
console.log('You clicked a button!');
/*let checkBox = document.getElementsByClassName('checkBox');
checkBox.addEventListener('checked', checkTheBox);*/
}
function clickFavorite (itemName) {
list.innerHTML += `<li class="checkBox">${itemName} <input type="checkbox"></li><br>`
}
const submitButton = document.getElementById('button');
submitButton.addEventListener('click', clickButton);
const coffeeButton = document.getElementById('coffee');
coffeeButton.addEventListener('click', () => clickFavorite("Coffee"));
const cokeButton = document.getElementById('cocaCola');
cokeButton.addEventListener('click', () => clickFavorite("Coca Cola"));
function checkTheBox () {
console.log('checked box')
}
};