changing the bg color of an active click function in jquery?
- by pingpong
basically i have this click function in jquery: (this is just a snippet, not full)
$('.block').click(function(){
var id= $(this).attr('id');
i want to chnage the background color of the block that has been clicked only, assigned with the id i.e.
$('.block').click(function(){
var id= $(this).attr('id');
$('.block').css('background-color','grey');
but where do i assign the id, so jquery knows, to only turn the clicked block into grey, not the others, cheers