Noob code question

Noob code question

Hello!
Im currently working on a wordpress page, using the fancybox plugin.
However, I did not post in the plugin section course i felt that this had more to do with jquery itself rather than the plugin im using.

Im an experienced php programmer, and I do know some basic JS, but I know nothing about jQuery :S

I got this code right now:
jQuery(thumbnails).addClass("fancybox").attr("rel","fancybox").getTitle();

What this does (I think) Is addoing a class and rel atribute to all my images.
What I WANT it to do is rather doing the same thing, to all my images inside a certain element!

...So, what I imagine I would need something like this:
jQuery(#myElement.img).addClass("fancybox").attr("rel","fancybox").getTitle();

Am I in the zone?
Please help :)