Professional Documents
Culture Documents
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Spreads</title>
<style>
.button-container {
display: flex;
justify-content: center;
margin-bottom: 20px;
}
.button {
border: none;
background-color: #f0f0f0;
padding: 10px 20px;
cursor: pointer;
font-size: 16px;
}
.button.active {
background-color: #ccc;
}
.content {
display: none;
}
.content.active {
display: block;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
th {
background-color: #f2f2f2;
font-weight: bold;
}
.exchange-logo {
height: 24px;
}
</style>
</head>
<body>
<div class="button-container">
<button class="button active" id="fxBtn">FX Spreads</button>
<button class="button" id="kriptoBtn">Crypto Spreads</button>
</div>
<script>
const fxBtn = document.getElementById("fxBtn");
const kriptoBtn = document.getElementById("kriptoBtn");
const fxContent = document.getElementById("fx");
const kriptoContent = document.getElementById("kripto");
kriptoBtn.addEventListener("click", () => {
kriptoContent.classList.add("active");
fxContent.classList.remove("active");
kriptoBtn.classList.add("active");
fxBtn.classList.remove("active");
});
fxBtn.addEventListener("click", () => {
kriptoContent.classList.remove("active");
fxContent.classList.add("active");
kriptoBtn.classList.remove("active");
fxBtn.classList.add("active");
});
if (!response.ok) {
throw new Error(`Binance API error: ${response.status}`);
}
document.getElementById("btc-usd-spread").innerText =
spread.toFixed(2);
} catch (error) {
console.error(error);
}
}
getBinanceSpreadData();
</script>
</body>
</html>