-
Notifications
You must be signed in to change notification settings - Fork 0
/
dom.js
27 lines (22 loc) · 925 Bytes
/
dom.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
//Use this for DOM ONLY!!!!!!!!!!!!
//----------schedule DOM-------------
let selection = document.getElementsByClassName('week_button');
let tables = document.getElementsByClassName('schedule_table');
console.log(tables[0].className);
console.log(tables[1].className);
console.log(tables[2].className);
selection[0].addEventListener('click', function(){
tables[0].className = "schedule_table";
tables[1].className = "schedule_table hide";
tables[2].className = "schedule_table hide";
});
selection[1].addEventListener('click', function(){
tables[1].className = "schedule_table";
tables[0].className = "schedule_table hide";
tables[2].className = "schedule_table hide";
});
selection[2].addEventListener('click', function(){
tables[2].className = "schedule_table";
tables[1].className = "schedule_table hide";
tables[0].className = "schedule_table hide";
});