I am attempting to utilize jQuery to extract the inner html of a div with the class name "box_bottom".
These divs are dynamically generated by JavaScript, fetching data from XML. As a result, there could be multiple occurrences based on the XML, and I need to account for that. Since I cannot target them by ID, I want to change the text color to blue if the content is "notifications" and red if the content is "VO".
$.category = $('.box_bottom').innerHTML;
if ($.category == 'Notifications') {
$(".box_bottom").css("color", "blue");
}
if ($.category == 'VO')
{
$(".box_bottom").css("color", "red");
}
The Chrome developer console is not indicating any errors, so I am unsure of where the issue lies.
I am fairly new to jQuery, so I have been searching for solutions online. I apologize if this is a basic problem.