How to send an image’s address property from an element to a quick view?

I created a quick preview of my products on the site so that the user can see the product information, including the product image, in a preview by clicking a button. This is the code for my view part where the product is on the site.
enter image description here
And this is a quick preview I made.
enter image description here
And this is the JavaScript part I wrote for it.
enter image description here

But encountered this error during execution.
enter image description here