matching images with captions

matching images with captions

Please suggest the correct way forwards for me to achieve this:

My page's images have identifying titles;
The bottom of the page contains the captions. The captions' container tags have matching titles.
So I'm trying to append the captions to their matching images.

I don't want to ask you to write the code for me, but it's becoming clear that I don't yet know the correct way to approach this in jQuery. I need a solution before I'll be able to learn the way, so please advise on the best general approach.