Lottery Odds Calculator
About this app
Calculate your odds of winning the lottery with 300 million combinations
Lottery Odds Calculator 🎫 Lottery Odds Calculator 🎰 Calculate your odds of winning the lottery with 300 million combinations. Enter the number of tickets you have: Calculate Odds
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>Lottery Odds Calculator</title>
<meta name="description" content="Calculate your odds of winning the lottery with 300 million combinations">
<meta name="keywords" content="lottery, odds, calculator, win">
<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 {
// Calculate odds
function calculateOdds(ticketsPurchased) {
const totalCombinations = 300000000;
const odds = ticketsPurchased / totalCombinations;
return odds;
}
// This will run when the DOM is ready.
document.addEventListener("DOMContentLoaded", function() {
document.querySelector("#calculate-btn").addEventListener("click", function() {
const tickets = document.querySelector("#tickets-input").value;
const odds = calculateOdds(tickets);
document.querySelector("#odds-output").textContent = "Your odds of winning are 1 in " + (1/odds).toFixed(0);
});
});
} catch (error) {
// This will throw the error to the parent window.
throw error;
}
</script>
<style>
/* App CSS Goes Here */
body {
background: #f5f5f5;
font-family: 'Helvetica', sans-serif;
}
.container {
margin-top: 50px;
}
.jumbotron {
padding: 2em 2em;
background: #ff9800;
color: #fff;
border-radius: 0px;
}
.jumbotron h1 {
font-size: 2em;
}
.jumbotron p {
font-size: 1.2em;
}
#odds-output {
font-size: 1.5em;
color: #2196f3;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<!-- App HTML Goes Here -->
<div class="jumbotron">
<h1>🎫 Lottery Odds Calculator 🎰</h1>
<p>Calculate your odds of winning the lottery with 300 million combinations.</p>
<div class="form-group">
<label for="tickets-input">Enter the number of tickets you have:</label>
<input type="number" class="form-control" id="tickets-input">
</div>
<button id="calculate-btn" class="btn btn-primary btn-lg mt-3">Calculate Odds</button>
<p id="odds-output" class="mt-3"></p>
</div>
</div>
</body>
</html>
NEW APPS
These are apps made by the community!