Calculator Tools Calculator Tools
Create

Number 6 Game

Sep 6, 2023

About this app

Play the Number 6 Game and test your math skills!

Number 6 Game Number 6 Game Click on the number 6 to win the game! 1 2 3 4 5 6 7 8 9 10

Related apps

Put this on your site

Source

                    <html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">

<title>Number 6 Game</title>
<meta name="description" content="Play the Number 6 Game and test your math skills!">
<meta name="keywords" content="number 6, game, math, skills, fun">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

<script type="text/javascript">
try {
// App Javascript Goes Here. Place your entire script content inside the try block for error handling.

// This will run when the DOM is ready.
document.addEventListener("DOMContentLoaded", function() {
// Generate a random number between 1 and 10
var randomNumber = Math.floor(Math.random() * 10) + 1;

// Display the random number on the page
$("#random-number").text(randomNumber);

// Check if the user clicked on the number 6
$(".number-button").click(function() {
var clickedNumber = $(this).text();

if (clickedNumber == randomNumber) {
$("#result").text("Congratulations! You found the number 6!");
} else {
$("#result").text("Oops! Try again!");
}
});
});

} catch (error) {
// This will throw the error to the parent window.
throw error;
}
</script>

<style>
/* App CSS Goes Here */
body {
background-color: #f5f5f5;
font-family: 'Arial', sans-serif;
}

.container {
max-width: 500px;
margin: 0 auto;
padding: 20px;
text-align: center;
}

h1 {
color: #333;
font-size: 24px;
margin-bottom: 20px;
}

.number-button {
display: inline-block;
margin: 10px;
padding: 10px 20px;
background-color: #007bff;
color: #fff;
font-size: 18px;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}

.number-button:hover {
background-color: #0056b3;
}

#result {
margin-top: 20px;
font-size: 18px;
font-weight: bold;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<h1>Number 6 Game</h1>

<p>Click on the number 6 to win the game!</p>

<div>
<button class="number-button">1</button>
<button class="number-button">2</button>
<button class="number-button">3</button>
<button class="number-button">4</button>
<button class="number-button">5</button>
<button class="number-button">6</button>
<button class="number-button">7</button>
<button class="number-button">8</button>
<button class="number-button">9</button>
<button class="number-button">10</button>
</div>

<p id="random-number"></p>

<p id="result"></p>
</div>
</body>
</html>