Question: How can I create this using javascript and insert it into a list? Where is going to be inserted into an I've tried this, but
How can I create this using javascript and insert it into a list?
Where
I've tried this, but it doesn't work
var listItem = document.createElement("li");
var aLink = document.createElement("a");
var imgTag = document.createElement("img");
imgTag.src = "image.png";
link.appendChild(imgTag);
listItem.appendChild(aLink);
document.getElementById("myList").appendChild(listItem);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
