-
Notifications
You must be signed in to change notification settings - Fork 1
/
style.js
36 lines (30 loc) · 1.12 KB
/
style.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
function opentab(evt, tabName) {
"use strict";
// Declare all variables
var i, tabcontent, tablinks;
// Get all elements with class="tabcontent" and hide them
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i = i + 1) {
tabcontent[i].style.display = "none";
}
// Get all elements with class="tablinks" and remove the class "active"
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i = i + 1) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
// Show the current tab, and add an "active" class to the link that opened the tab
document.getElementById(tabName).style.display = "block";
evt.currentTarget.className += " active";
}
function showValue(newValue) {
"use strict";
document.getElementById("energy").innerHTML = newValue;
}
function showValue1(newValue1) {
"use strict";
document.getElementById("water").innerHTML = newValue1;
}
function showValue2(newValue2) {
"use strict";
document.getElementById("waste").innerHTML = newValue2;
}