Reputation: 20444
I am trying to remove a CSS property from all elements with a certain class. I tried this but it did not work.
$(document).ready(function(){
$(".TABlink").click(function(){
$('.TABlink').css('background-image','')
}); });
That is supposed to remove a background image from all elements with that class if one of them is clicked. Not working.
Any ideas,
Marvellous
Upvotes: 1
Views: 1917
Reputation: 770
Maybe late, but it might be useful for future viewers : I had the same requirement, although with background-color. The following function worked for me fine :
$('.className').css('background-color','white');
I had to mention the new-color ('white'), specifying 'none' didn't work.
Upvotes: 0
Reputation: 17752
Try this, maybe it doesn't like empty property value:
$(document).ready(function(){
$(".TABlink").click(function(){
$('.TABlink').css('background-image','none');
});
});
Upvotes: 5