I want to save a background color of an element in a variable which I sent with an AJAX call, so I can use it in a PHP SESSION, but for some reason I cannot save this css in the variable.
var color_rgb = $( "#config-steps #selected-color" ).css( 'background-color' );
My AJAX call works fine, I have tested to put a test string in color_rgb
and this works fine.
$.ajax( {
type: "POST",
url: sbg.ajaxurl,
data: {
color_rgb: color_rgb,
action: 'sbg_config'
}
});
Has anyone an idea how to fix this?