const button = document.getElementById("getcucc") button.addEventListener("click", () =>{ let xhr = new XMLHttpRequest() xhr.onreadystatechange = () =>{ if (xhr.readyState === 4 && xhr.status === 200){ let adat = JSON.parse(xhr.responseText) console.log(adat) let tohtml = "" for (let user of adat.data){ tohtml += `

${user.first_name}

` tohtml += `
` tohtml += `

${user.email}

` } document.getElementById("cucc").innerHTML = tohtml } } xhr.open("GET", "https://reqres.in/api/users?page=2") xhr.send() })