[Solved] How I Set Property of Element In InnerHtml


(document.getElementsByTagName('img').PicsCircleMan.innerHTML).src =picsListMan[indexMan].img;

document.getElementsByTagName returns a nodeList (array-like object) of all elements with the provided tag name. You can then access them with [i] where i is an array index. .PicsCircleMan means absolutely nothing there.

.innerHTML returns a string of the html code found inside an element.

.src is an attribute of img elements, but you’re trying to set a src attribute on the innerHTML string, which doesn’t mean anything.

You probably wanted to do someting like:
document.getElementsByTagName("img")[0].src = "https://stackoverflow.com/questions/30576992/something.jpg";

solved How I Set Property of Element In InnerHtml