Going off this question: Selecting elements with a certain background color
I wanted to change the background of ALL elements with background of a certain color. I tried the method mentioned in the answer, but it doesn't seem to work for me.
jQuery:
// using string
$('*').filter(function(){
return ( $(this).css('background-color') == 'green' );
}).css('background', 'blue');
// using hex
$('*').filter(
return ( $(this).css('background') == '#a3a3a3' );
}).css('background', 'red');
Here's the JS Bin