nyazoom/dist/scripts/cat_fact_fetcher.js

6 lines
152 B
JavaScript
Raw Normal View History

2023-07-26 08:53:41 +00:00
fetch("https://catfact.ninja/fact")
.then(data => data.json())
.then(data => {
document.getElementById("cat-fact").innerHTML = data.fact;
});