There is a div parent in which a large number of child divs lie. With this design, I get the number of the child div, which was clicked:
document.querySelector('#main').addEventListener("click", function(evt){ log = [].indexOf.call(this.children, evt.target); }); Then, using evt.target, I can change the content of the div I clicked on:
evt.target.innerHTML = "lorem ipsum"; Suppose that I recorded the number 32 in the log variable (which corresponds to the 32nd div in the parent block), but now I want to change the innerHTML property of the next div, for example, number 33 (well, or 1 44). Can I get some sort of event.target using the div number, so that I can change the innerHTML value in it?