I am trying to change the CSS of one element on click of another element. I\'ve searched a lot but nothing works perfectly. Currently I am using the below code, but it doesn
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');
});