Webchance/static/app.js
Gian Breitenstein 073bf775db init
2024-09-26 16:43:51 +02:00

14 lines
434 B
JavaScript

async function getData() {
const chance = document.getElementById("Chance").value
const mult = document.getElementById("Multiplicator").value
const url = "/random?chance="+chance+"&multiplicator="+mult;
try {
const response = await fetch(url);
const content = await response.text()
document.getElementById("won").innerText=content
} catch (error) {
console.error(error.message);
}
}