On my webpage, I have implemented a feature where I can click on an image to enlarge it. Clicking on the image again shrinks it back to its original size. However, I am encountering an issue where only the latest image added to the screen is resizable, even though none of the variables are being modified. This functionality is part of a game I am currently developing. I have created a sample page with minimal code to test this feature, which can be accessed here: My goal is to enable the ability to click on any image at any time and have it grow and shrink accordingly.