I am loading in HTML from AJAX using JQuery. I am then triggering a click event on certain elements within the newly loaded HTML.
I am having a problem with setting the css on the newly loaded elements.
Here is the code...
function updateScreen(year, month) {
$.ajax({
url:'ajax_php/get_year_data.php',
data: 'year=any',
type: 'post',
success: function(data) {
$('.top-container').html(data);
// highlight year
$("#" + year).click();
// and month
$("#" + year + ' .' + month).click();
$("#" + year + ' .' + month).css('background-color', convertHex('#9FC7F5', 20))
console.log($("#" + year + ' .' + month).css('background-color'));
}
});
}
The console.log returns what I expect to see but the screen does not show the change in background color.
Can anyone tell me why?
cheers, George