function addUser() { const usersPara = document.createElement("p"); let xhr = new XMLHttpRequest(); xhr.open("GET", "user.json", true); xhr.onload = function () { console.log(xhr.responseText); let obj = JSON.parse(xhr.responseText); if (this.status === 200) { usersPara.innerText = `${obj.name} , ${obj.age} , ${obj.status}, ${obj.class}`; defaultDIv.appendChild(usersPara); } }; xhr.send(); }