Trying to write a script that checks the content of a div, and if that content is exactly 0 than it hides the div. This is for an inbox system so that the count only shows if you have a new message. This is what I wrote:

```js
var count = $('.count').val();
if (count == '0') {
  $('.count').hide();
} else {
  $('.count').show();
}
```

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<a href='index.php?act=UserCP&CODE=alerts'>
  <span class="count"><!-- |new_alerts| --></span> alerts</a>
<a href='index.php?act=Msg&CODE=01'>
  <span class="count"><!-- |new_msg| --></span> inbox</a>
```

[Site Where the Problem is Occurring.](https://colourcoded.jcink.net/index.php?act=idx)

The `<!--|new_msg| -->` is part of the hosting site's user menu system. On the site it changes to a number, correlating to how many new alerts or new messages you have. Is this the reason? The div has an actual number on the site, so it should read that right?