20 lines
526 B
HTML
20 lines
526 B
HTML
<!doctype html>
|
|
<html>
|
|
<body>
|
|
<p id="price"></p>
|
|
|
|
<script>
|
|
fetch("https://api.bitlab21.com/price")
|
|
.then((response) => response.json())
|
|
.then((data) => {
|
|
var lastElement = data[data.length - 1];
|
|
document.getElementById("price").innerHTML =
|
|
`The current price is: <em>$ ${lastElement.price.toLocaleString()}</em> (${lastElement.date}) `;
|
|
})
|
|
.catch((error) => {
|
|
console.error("Error:", error);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|