<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta http-equiv="Content-Security-Policy" content="default-src * data: gap: content: https://ssl.gstatic.com; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'"> <script src="components/loader.js"></script> <link rel="stylesheet" href="components/loader.css"> <link rel="stylesheet" href="css/style.css"> <script> function quiz3(){ var answer = prompt("ヒント:英語で3文字だよ"); if(answer == "var"){ alert("すごい!正解だよ!"); location.href = "record.html"; sessionStorage.score++; }else{ alert("残念!はずれ!"); location.href = "record.html"; } } </script> </head> <body> <h1>第3問</h1> <p>JavaScriptで変数を作るときに使う命令は?</p> <button onclick="quiz3();">答えを入力</button> </body> </html>
※コード部分をダブルクリックすると全選択ができます。