Why won't this set the css for the .btn-post element. I've tried putting it in a function as well.
var variable = "hsla(359, 61%, 30%, 1);"
$('.btn-post').css('background', variable );
Why won't this set the css for the .btn-post element. I've tried putting it in a function as well.
var variable = "hsla(359, 61%, 30%, 1);"
$('.btn-post').css('background', variable );
May be you need a doc ready handler for it:
$(function(){
var variable = "hsla(359, 61%, 30%, 1)";
$('.btn-post').css('background', variable );
});
Try this:
var variable = "hsla(359, 61%, 30%, 1)";
$('.btn-post').css('background-color', variable );