-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
35 lines (27 loc) · 1.12 KB
/
script.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
var proceedButton = document.getElementById("proceedButton");
if (proceedButton) {
proceedButton.addEventListener("click", redirectHome);
}
function redirectHome() {
location.href = "home.html";
console.log = "You're on the Home Page";
}
var mythsList = [
"Myth - Sexual violence is as a result of clothing. <br><br> Fact - The only cause of sexual violence is choosing to violate another person. The victim’s appearance has no effect on their right to say no.",
"Myth - Sexual violence only happens to women. <br><br> Fact - Men as well are victims of sexual violence.",
"Myth - Only strangers are likely to sexually assault someone. <br><br> Fact - Among victims aged 18 to 29, ⅔ of them knew the offender. ",
];
var fact = document.getElementById("fact");
var generateFactsButton = document.getElementById("generateFactsButton");
var count = 0;
if (generateFactsButton) {
generateFactsButton.addEventListener("click", displayFact);
}
function displayFact() {
fact.innerHTML = mythsList[count];
count++;
if (count == mythsList.length) {
count = 0;
console.log("mythsList fact:", mythsList[count]);
}
}