sndu sndu - 8 months ago 77
HTML Question

How to change the displayed value when the view is clicked?

I have this notification list which I have created using HTML and Thymeleaf. Here I am displaying the number of notifications using

which displays the value properly.

<li class="dropdown messages-menu">
<a id="notification-href" href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-envelope-o"></i>
<span class="label label-success"><span id ="notification-count" th:text="${#lists.size(notifications)}"></span></span>

Once I have clicked the notification list, I want to change the notification count to zero. For this I have wrote following function.

$("#notification-count") == 0;

This function does not work and I see no errors or exceptions either. Can anyone tell what is wrong here?

Answer Source

You should use something like this:


// or

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download