I'm attempting to create a comments counter div that changes color based on the number of comments. If there are 0 comments, the div should be red, and if there are more than 0 comments, the div should be blue. However, I am encountering an issue with JavaScript duplicating the same colors.
$(function () {
if(parseInt($(".notification-counter").text()) > 0) {
//$(".notification-counter").hide();
$('.notification-container').addClass('notification-container2');
}
});
Check out the code here: http://jsfiddle.net/783h57zy/10/
Thank you for any assistance!