For the completely changed question:
You can use the class they have for a selector and just reference this.id, like this:
$('.img').click(function() {
alert('hi, my ID is: ' + this.id);
});
Original:
You can use their IDs in a selector, like this
$("#rem1, #rem2, #rem3").click(function() {
alert('hi, my source is:' + this.src);
});
Or, give them a class, like this:
<img id="rem1" src="img" class="myClass" />
<img id="rem2" src="img" class="myClass" />
<img id="rem3" src="img" class="myClass" />
and use that class for your selector, like this:
$(".myClass").click(function() {
alert('hi!');
});
In either case, be sure to wrap this code in a document.ready event handler so it doesn't run until the elements are ready, like this:
$(function() {
$(".myClass").click(function() {
alert('hi, my source is:' + this.src);
});
});