JSFiddle - React, Tailwind, and code Playground
by AlexP11223
HTML
<div id="insertHere">
Hello!
</div>
JavaScript
fetch('https://www.banki.ru/products/currency/eur/')
.then(r => r.text())
.then(html => {
const parser = new DOMParser()
const doc = parser.parseFromString(html, 'text/html')
const currencyTable = doc.documentElement.querySelector('.currency-table')
document.querySelector('#insertHere').appendChild(currencyTable)
})
fetch('https://www.banki.ru/products/api/cities/top/?limit=5')
.then(r => r.json())
.then(data => {
const citiesHtml = '<ul>' + data.data.map(city => `<li>${city.name}</li>`).join('') + '</ul>'
document.querySelector('#insertHere').insertAdjacentHTML('beforeend', citiesHtml)
})