-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.js
26 lines (26 loc) · 1.04 KB
/
popup.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
document.addEventListener('DOMContentLoaded', function() {
var getHabitButton = document.getElementById('getHabit');
var count = 0;
getHabitButton.addEventListener('click', function() {
var data = {
"habits":[
{"habit":"Eat Breakfast Every Morning"},
{"habit":"Add Fish & Omega-3 Fatty Acids To Your Diet"},
{"habit":"Get Enough Sleep"},
{"habit":"Make Social Connections"},
{"habit":"Exercise For Better Health"},
{"habit":"Practice Dental Hygiene"},
{"habit":"Take Up A Hobby"},
{"habit":"Protect Your Skin"},
{"habit":"Snack The Healthy Way"},
{"habit":"Drink Water & Eat Dairy"},
{"habit":"Drink Tea"},
{"habit":"Take A Daily Walk"},
{"habit":"Plan"}
]
}
document.getElementById('habit').innerHTML =
data.habits[count%13].habit;
count = count +1;
}, false);
}, false);