How can I add hover text to images of a basic gallery on wordpress elementor?

Your question doesn’t show any code examples or tell me a lot about what you want to show in the caption, so I’ll leave that out and make up my own code.

Here is one way to show a caption on hover using jQuery: https://jsfiddle.net/steckinsights/yzfpg7n0/25/

Now, doing this with a gallery means that you’ll need to do a lot more to this (looping through the images, wrapping the image and the caption in an element, adding a unique ID or class to the image and caption) but this is a basic answer to your question of how it could be done.

One of many ways including:

  • Set image as BG image and use the ::after CSS element to display comment
  • Loop images with PHP and pull comment from alt tag using jQuery
  • Use one of many plugins that do this out of the box
  • etc.