I have list elements like so:
<li>
<strong style="color: #BBB;">1</strong>
<a href="">Matt</a>
<b>4 days ago</b>
<img id="911" class="commentlike" src="../Images/likesred.png">
<p>20ptanswerlol</p>
</li>
I currently have an onclick event for the img, and it works perfectly. What i am trying to do is make the onclick event in jquery change the number “1” in the to a 0 or 2. Basically i want the text inside to add one or subtract one.
first i have to find the element, but i can’t seem to do so… Any help?
Thanks.
To find the
<strong>tag from the<img>:And to retrieve, increment and update it’s value:
So now we have:
To subtract 1, just do
number--or whatever other logic you need to.