How to add a new CSS class to a Link Badge if the value is 0? I'm using the small module Link Badges to display a badge with the amount of flagged nodes next to a link to the View in question. It works great and I've styled the badge to my needs. This is the current HTML code:

&lt;a class="menu__link menu__link link-badge-wrapper"&gt;
  &lt;span class="link-badge-text"&gt;My View&lt;/span&gt;
  &lt;span class="link-badge-badge-wrapper"&gt;
    &lt;span class="link-badge link-badge-menu_badges_execute_view"&gt;0&lt;/span&gt;
  &lt;/span&gt;
&lt;/a&gt;


Now, I'd like to display the badge a little bit differently (other colors etc.) when the value is 0. I thought about doing this by adding a new CSS class link-badge-zero to the value.

&lt;a class="menu__link menu__link link-badge-wrapper"&gt;
  &lt;span class="link-badge-text"&gt;My View&lt;/span&gt;
  &lt;span class="link-badge-badge-wrapper"&gt;
    &lt;span class="link-badge link-badge-zero link-badge-menu_badges_execute_view"&gt;0&lt;/span&gt;
  &lt;/span&gt;
&lt;/a&gt;


How can I achieve this?
Thanks to @Ramis Wachtler at Stack Overflow, I got the following JQuery code:

if($(".link-badge").text() == "0"){
    $(".link-badge").addClass("link-badge-zero");
}


Possible easier solutions are always welcome.