Reputation: 770
i want to change the background-color of an element with jquery from:
background: transparent linear-gradient(#C0B 45%, #C0B)
into:
background-color:#000;
i tried to remove the background-property with .removeAttr(), but nothing works.
Upvotes: 1
Views: 66
Reputation: 20740
You can do it like below.
$('#element_id').css('background', 'none'); // remove background
$('#element_id').css('background-color', '#000'); // set background color
You can combine two line like below.
$('#element_id').css({'background':'none', 'background-color': '#000'});
Upvotes: 1
Reputation: 770
i found a way. you have to do it like this:
$(this).css("background","none");
after that you can add your own background-properties.
Upvotes: 1