I am trying to use a for loop to only display the name of my API random user data and only want to display the name right now. I eventually expect my app to be similar to this app:
Instead I get no output in my card body div and get an error in my console when I press the button:
Code that I think is relevant to my error:
let output='';
// for(var i in users){
// // output+='<ul>'+'<li>ID:'+users[i].id+'</li>'+'<li>LOGIN:'+users[i].login+'</li>'+'<li>NODE ID:'+users[i].node_id+'</li>'+'</ul>';
// output+='<div class="user">'+'<img src="'+users[i].avatar_url+'" width="70" height="70">'+'<ul>'+'<li> ID : '+users[i].id+ '</li>'+'<li> LOGIN : '+users[i].login+ '</li>'+
// '<li> NODE ID: '+users[i].node_id+ '</li>'+'</ul>'+'</div>';
// }
for(let i in data){
output+='<h3>Name : '+data[i].results[0].name[i]+'</h3>';
}
cardbody.innerHTML=output;
Here is the link to my code:https://codepen.io/noblegas/pen/jObLJXY
I am also having issues with the border of my box container and keep outputting blurry images as you probably can already see