回答編集履歴

1

2022/01/31 14:57

投稿

退会済みユーザー
test CHANGED
@@ -17,3 +17,23 @@
17
17
  image(src="./images/Decision2.jpg" alt="ゲームを開始する")
18
18
  ```
19
19
 
20
+ ---
21
+
22
+ 追記です。
23
+ `button`にすると見た目が微妙に変わってしまうため、直接`image`を記述して画像をクリックした時のイベントをつけることでも対応できると思います。
24
+
25
+ ```pug
26
+ .start
27
+ image(src="./images/Decision2.jpg" alt="ゲームを開始する", id="image1")
28
+ script(type='text/javascript').
29
+ function link() {
30
+ var zelda = document.form1.piece[0].checked;
31
+ if (zelda) {
32
+ document.location = "./play";
33
+ } else {
34
+ document.location = "./play_inaba";
35
+ }
36
+ }
37
+ document.querySelector("#image1").addEventListener("click", link)
38
+ ```
39
+