質問編集履歴

1

javascriptを追記しました

2021/07/19 04:30

投稿

newbie0
newbie0

スコア0

test CHANGED
File without changes
test CHANGED
@@ -98,6 +98,42 @@
98
98
 
99
99
  ```
100
100
 
101
+ ```javascript
102
+
103
+ <script>
104
+
105
+ function diceFunc1() {
106
+
107
+ var dice1 = Math.floor(Math.random() * 6) + 1;
108
+
109
+ document.getElementById("dice1d6").innerHTML = dice1;
110
+
111
+ }
112
+
113
+ function diceFunc2() {
114
+
115
+ var dice2 = Math.floor(Math.random() * 6) + 1;
116
+
117
+ var dice3 = Math.floor(Math.random() * 6) + 1;
118
+
119
+ document.getElementById("dice2d6").innerHTML = dice2+dice3;
120
+
121
+ }
122
+
123
+ function diceFunc3() {
124
+
125
+ var dice4 = Math.floor(Math.random() * 6) + 1;
126
+
127
+ var dice5 = Math.floor(Math.random() * 6) + 1;
128
+
129
+ var dice6 = Math.floor(Math.random() * 6) + 1;
130
+
131
+ document.getElementById("dice3d6").innerHTML = dice4+dice5+dice6;
132
+
133
+ }
134
+
135
+ </script>
136
+
101
137
  ```
102
138
 
103
139