-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaster.js
27 lines (22 loc) · 999 Bytes
/
master.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
var button = document.getElementById("start");
button.onclick = function(){
if ((document.getElementById("name").value != "") && (document.getElementById("age").value != "")
&& (((document.getElementById("male").checked) === (!document.getElementById("female").checked))) === (!document.getElementById("nonbinary").checked)){
alert("Find the bee in the photo\nPress OK to start");
sessionStorage.setItem('name',document.getElementById("name").value);
sessionStorage.setItem('age',document.getElementById("age").value);
if (document.getElementById("male").checked){
sessionStorage.setItem('sex','Male');
}
else if(document.getElementById("female").checked){
sessionStorage.setItem('sex','Female');
}
else{
sessionStorage.setItem('sex','Non-Binary');
}
window.location.href ='pg1.html';
}
else{
alert("Please fill in all the necessary details.");
}
};