getting value of a clicked element

getting value of a clicked element

If I have an img tag with id="blah" and value="x" I know can get the value with:

$('#blah).val();

but if I have that several img tag created in a foreach() loop, how can I get its value as several selectors with the same id is not possible? probably I can use id="blah[]" or I can append an incrementing id like id="blah1", id="blah2", then how can I get the value as I will not know the id? or may be I should just use a .click() event to get the id of clicked element then get its value by id? if yes, how is the code to do so?