<!DOCTYPE html>
<html>
<head>
<title>1から100までの数字をランダム表示する</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
button {
font-size: 24px;
padding: 10px 20px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #3e8e41;
}
#number-display {
font-size: 48px;
font-weight: bold;
margin-top: 50px;
}
</style>
</head>
<body>
<h1>1から100までの数字をランダム表示するアプリ</h1>
<button onclick="randomNumber()">数字を表示する</button>
<div id="number-display"></div>
<script type="text/javascript">
function randomNumber() {
var numberDisplay = document.getElementById("number-display");
numberDisplay.innerHTML = Math.floor(Math.random() * 100) + 1;
}
</script>
</body>
</html>
<!-- 「5と8が闘う時、8が勝つ理由は?」
「8はつくづく偉大な数字だから」 -->