Code not showing array

Hello I would like to know why I dont get the image displayed with its own info(title and description), help please, thanks

var myArray = [{
  title: "my title",
  description: "my description.",
  image.src = "https://lithub.com/wp-content/uploads/2018/06/milky-way.jpg";
}]

function displayObject() {
  var containerImg = document.getElementById("containerImg ");
  containerImg.appendChild(myArray);
}
displayObject();

appendChild expects Node: https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild not an array.

Also your array has syntactic errors (at image.src).

1 Like

You also need to provide full code HTML for other developers to follow your code.

1 Like