Spaces:
Runtime error
Runtime error
File size: 1,200 Bytes
ddbd3d5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Random Value Beep</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
margin-top: 50px;
}
button {
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
}
</style>
</head>
<body>
<h1>Random Value Checker</h1>
<button id="generateButton">Generate Random Value</button>
<p id="result"></p>
<audio id="beepSound" src="/alarn_tune.mp3"></audio>
<script>
document.getElementById("generateButton").onclick = function() {
// Generate a random value between 0 and 20
var randomValue = Math.floor(Math.random() * 21);
document.getElementById("result").innerText = "Generated Value: " + randomValue;
// Check if the random value is greater than 10
if (randomValue > 10) {
document.getElementById("beepSound").play();
}
}
</script>
</body>
</html>
|