devxlogo

Changing an Image Src in a DIV From Another DIV

Changing an Image Src in a DIV From Another DIV

Question:
I can’t reach an image src in a DIV from another DIV in Netscape. Do you have any suggestions?

Answer:
The problem that you’re running into here is that Netscape doesn’t retain content information about the elements once they are drawn. Thus, a DIV object doesn’t know about its interior contents. In this case, the simplest solution is to maintain information about the desired source and target images in a JavaScript function, then when the code changes the source, it also updates the target.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist