With jquery you can do it like:
$('img').click(function(){
$('#foo').css('background-color', 'red').css('color', 'white');
});
this applies for all img
tags you should set an id
attribute for it like image
and then:
$('#image').click(function(){
$('#foo').css('background-color', 'red').css('color', 'white');
});