I have used InsertAdjacentHTML to insert a dynamic number of images onto a page in Internet Explorer 4. Having given the new images a single ID, I can refer to images in the script using I, I, etc., and alter properties for each image. However, events seem to be ignored for all of these images. Can you tell me why this is happening in IE and how I can create a cross-browser solution?
where testImage is the name of the group of images being created. The routine GetImageIndex is defined in the HTML sample below, showing how you can retrieve the index of the image that you’re currently clicking on or mousing over. This solution is IE4+ specific, although the Netscape test is similar: change the output(id,whichText) handler to handle the document.id.document.write() call instead of insertAdjacentHTML().