Here is the code I am currently using:
$(this).css('backgroundcolor', localStorage.getItem('bgColorr') + " !important;");
When I execute this:
alert( localStorage.getItem('bgColorr') + " !important;");
I receive the correct alert which is rgb(243,102,42) !important; ....
This issue is really bothering me.. thank you for your help!
Edit:
The surrounding code snippet is as follows:
$(function() {
$(this).css('background-color', localStorage.getItem('bgColorr'));
});
var colorOptions = '#000, #fff, #abf7ae, #f6cbe9, #53c68f, #53c1c6, #538dc6, #c6536b'.split(', '),
colorDivs = [],
colorsContainer = $('#colorsContainer');
for ( var i = 0, len = colorOptions.length; i < len; i++ ) {
var div = $('<div />').css('background', colorOptions[i])[0];
colorDivs.push(div);
}
colorsContainer.append(colorDivs);
$('#header').hover(function() {
colorsContainer
.fadeIn(200)
.children('div')
.click(function() {
$('body').css('background', $(this).css('backgroundColor'));
localStorage.setItem('bgColorr', $(this).css('backgroundColor'));
});
}, function() {
colorsContainer.fadeOut(200);
});
That should do it, thanks everyone!