Pass the id which enabled the onclick fuction

Hello,
I am trying to create my first website. The only issue i have is that when i try to run a function with .onclick on an image, i cannot pass the id of the image that was clicked.

Can you please help me? Thank you in advance.

What are you actually trying to pass here as you can use id to get the image id or the onClick itself.
https://www.wix.com/corvid/reference/$w.Image.html#id
https://www.wix.com/corvid/reference/$w.Image.html#onClick

Otherwise you could look at utilizing the alt text or tooltip text for your needs.
https://www.wix.com/corvid/reference/$w.Image.html#alt
https://www.wix.com/corvid/reference/$w.Image.html#tooltip

Thank you for your reply,

What i mean is that i have 20 images in my page but don’t want to write onclick function for each one. So i just want to get the id of the image when the user press on it and pass it into the function.

Sorry if i am a bad student but it’s my first time trying to build a site.