EXAMPLE
I'm trying to set the background of an element to a gradient, however it's not setting. It's adding style=""
to markup and it works when I put the code directly into firebug (I'm using Firefox). Any idea why it's not working or how I can get it to work?
$('main > article').each(function (index) {
var bg = $(this).css('background-color');
var nextbg = $(this).next().css('background-color');
if ($(this).next().length && nextbg != bg) {
$(this).css('background', 'linear-gradient(to bottom, ' + bg + ' 0%, ' + nextbg + ' 100%);');
console.log('linear-gradient(to bottom, ' + bg + ' 0%, ' + nextbg + ' 100%);');
console.log('------------');
}
});