JSFiddle - React, Tailwind, and code Playground
HTML
<p id="difficulty">Replace this</p>
CSS
#difficulty {
width: 200px;
height: 50px;
background-color: yellow;
padding: 10px 10px;
box-sizing: border-box;
}
JavaScript
fetch("https://blockchain.info/q/getdifficulty")
.then(res => res.json())
.then(data => {
console.log(data)
document.getElementById("difficulty").innerHTML = data;
});