-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjs_file1.html
More file actions
92 lines (75 loc) · 2.53 KB
/
Copy pathjs_file1.html
File metadata and controls
92 lines (75 loc) · 2.53 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html lang="en">
<head>
<title>Dice Roll</title>
<style>
body{background-color: bisque;}
button{background-color: chocolate; border-radius: 10px;font-weight: bold; margin:30px}
h1{ background-color: aquamarine;}
#div1{ border:1px solid black;margin:10px}
.div2{ border:1px solid black;margin:30px}
lable{ margin: 30px;}
</style>
</head>
<body>
<h1> RANDOM NUMBERS </h1>
<div class="div1" >
<div class="div2">
<lable id="xid" > X </lable>
<span>---------------</span>
<lable id="xvalue"> X value</lable>
<br><br>
<lable id="yid" > X </lable>
<span>---------------</span>
<lable id="yvalue"> Y value</lable>
<br><br>
<lable id="zid" > Z </lable>
<span>---------------</span>
<lable id="zvalue"> Z value</lable>
<br><br>
<button onclick="roll()">NUMBER TROLL </button>
<br><br>
</div>
</div>
<div class="div1">
<div class="div2">
<h1> ALPHABET NUMBERS </h1>
<lable id="xalphaid" > X </lable>
<span>---------------</span>
<lable id="xalphavalue"> X alpha value</lable>
<br><br>
<lable id="yalphaid" > X </lable>
<span>---------------</span>
<lable id="yalphavalue"> Y alpha value</lable>
<br><br>
<lable id="zalphaid" > Z </lable>
<span>---------------</span>
<lable id="zalphavalue"> Z alpha value</lable>
<br><br>
<button onclick="alpha_roll()">ALPHABET TROLL </button>
<br><br>
</div>
</div>
<script>
function roll()
{
let xvalue= Math.floor(Math.random() *19 +1);
let yvalue= Math.floor(Math.random() * 13 +1);
let zvalue= Math.floor(Math.random() *17 +1);
document.getElementById("xvalue").innerHTML=xvalue ;
document.getElementById("yvalue").innerHTML=yvalue ;
document.getElementById("zvalue").innerHTML=zvalue ;
}
function alpha_roll()
{
const randomLatters="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
let randomIndex_x = Math.floor(Math.random()*52 +1 );
let randomIndex_y = Math.floor(Math.random()*52 +1 );
let randomIndex_z = Math.floor(Math.random()*52 +1 );
document.getElementById("xalphavalue").innerHTML=randomLatters[randomIndex_x];
document.getElementById("yalphavalue").innerHTML=randomLatters[randomIndex_y];
document.getElementById("zalphavalue").innerHTML=randomLatters[randomIndex_z];
}
</script>
</body>
</html>