<h2></h2>
<div>Last: <span></span></div>
const elTitle = document.querySelector('h2');
const elText = document.querySelector('div > span');
const PAIR = 'BTC/USDT';
const exchange = new ccxt.binance ();
const update = async () => {
const { last } = await exchange.fetchTicker(PAIR);
elTitle.innerText = PAIR;
elText.innerText = last;
setTimeout(update, 5000);
};
update();
This Pen doesn't use any external CSS resources.