-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
51 lines (46 loc) · 1.82 KB
/
index.html
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html>
<head>
<title>RockPapperScissor</title>
<link rel="stylesheet" type="text/css" href="RockPaperScissor.css">
</head>
<body onload="MarkAllChecked()";>
<div class="heading">
<p>Play RockPaperScissor </p>
</div>
<div>
<form class="Form">
<fieldset class="field">
<legend align="center">General Information</legend>
<!-- UserName -->
<div class="Name"><label class="name"><span class="username">UserName</span> <br><input type="Text" name="UserName" value="User" class="IPtext"></label><br></div>
<div class="gender">
<span class="Wgender">Gender </span><br>
<!-- OPtions for Gender -->
<label class="male">Male <input id="MaLe" type="radio" name="Gender" checked value="male" onclick="MarkChecked()";></input></label>
<label class="female">Female <input type="radio" name="Gender" value="female" onclick="MarkUnchecked()"; ></input></label><br></div>
<!-- BUTTON TO START THE GAME -->
<a href="index1.html" class="playgame" onclick="Makechanges()";>Start Game</a>
</fieldset>
</form>
<script type="text/javascript">
function MarkAllChecked() {
document.getElementById("MaLe").checked = true;
console.log(document.getElementById("MaLe").checked);
}
function MarkUnchecked() {
document.getElementById("MaLe").checked = false;
console.log(document.getElementById("MaLe").checked);
}
function MarkChecked() {
document.getElementById("MaLe").checked = true;
console.log(document.getElementById("MaLe").checked);
}
function Makechanges(argument) {
sessionStorage.setItem("PlayerName",document.querySelector('.IPtext').value);
sessionStorage.setItem("PlayerGender",document.getElementById("MaLe").checked);}
// localStorage.setItem("PlayerGenderfemale",document.querySelector('.female').value);
</script>
</div>
</body>
</html>