I have a fiddle which I have replicated by seeing the screenshot below.
The fiddle is working in a way that on click of the 2 square boxes, another box appears at the bottom.
The JQuery code which I have used in order to get that:
$("#franchisehub").click(function() {
if ($('.franchisehubtv').css('display') == "flex") {
$('.franchisehubtv').css('display', 'none');
} else {
$('#franchisehub').css('background-color', 'green');
$('#franchisehub p').css('color', 'white'); // Added line
$('#cloudbasedmobile').css('background-color', 'white');
$('#businessanalytics').css('background-color', 'white');
$('#techsupport').css('background-color', 'white');
$('#ordermanagement').css('background-color', 'white');
$('#employeemanagement').css('background-color', 'white');
$('#whitelabel').css('background-color', 'white');
$('#emailmarketing').css('background-color', 'white');
$('#royaltycalculator').css('background-color', 'white');
$('#customizationtools').css('background-color', 'white');
$('#goalsetting').css('background-color', 'white');
$('#custominvoicing').css('background-color', 'white');
$('#leadtracking').css('background-color', 'white');
$('#brandcontrol').css('background-color', 'white');
$('.franchisehubtv').css('display', 'flex');
$('.cloudbasedtextipad').css('display', 'none');
$('.business-analytics').css('display', 'none');
$('.tech-support').css('display', 'none');
$('.order-management').css('display', 'none');
$('.employee-management').css('display', 'none');
$('.white-label').css('display', 'none');
$('.brand-control').css('display', 'none');
$('.lead-tracking').css('display', 'none');
$('.custom-invoicing').css('display', 'none');
$('.goal-setting').css('display', 'none');
$('.customization-tools').css('display', 'none');
$('.royalty-calculator').css('display', 'none');
$('.email-marketing').css('display', 'none');
}
});
Problem Statement:
What I am trying to accomplish is, on click of a green image as present in the screenshot above, the text color (Franchise Hub or Cloud Based & Mobile) inside that 2 squares boxes should turn WHITE.
I have used the following line in order to make that happen but it doesn't seems to work.
$('#franchisehub p').css('color', 'white'); // Added line

<p>that has its own colour.$('#franchisehub p').css('color', 'blue !important');just change 'blue !important' to 'white' and it should work. If not, which browser are you using?!importantand it works just fine. jsfiddle.net/bL19pg8g