if(prev_clicked)
{
$(\"#accordion li a.category\").css(\'background-image\', \'url(\"img/off_all_channel.png\")\');
$(\"#accordion li
This is literally a copy paste from this answer, and I use it to clear CSS style that I added with jQuery in a previously executed function.
To remove the in-line CSS property use:
$('.className').css({propertyName: ''});
To remove the whole in-line style of an element use:
$('.className').removeAttr('style');
OR by ID:
$('#idName').removeAttr('style');
I was having this problem but I have not seen any solution here that satisfies the OP. Most of the solutions suggest getting rid of the entire style attribute which is not worth it.
I used jQuery's prop method.
var styleObject = $('my-selector').prop('style');
styleObject.removeProperty('background-color');
Either you can set the properties back to blank:
$(".icha0").css("background-color","");
Or you can change the code to use classes defined in a CSS file:
$(".icha0").addClass('properties');
$(".icha0").removeClass('properties');
To remove all CSS property in JQuery the following code can be use:
$(".selector").removeClass().removeAttr('style');
Thanks.