• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Count each value on button

Resolved: Count each value on button

0
By Isaac Tonny on 18/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I try to count each value in each button
This is the example
The PHP Code
Jquery
But it didn’t work at all. Anyone can tell me where this code goes wrong?

Answer:

You don’t need to use the id’s for this, you can use .find() to find the child based on your html.
Then get the “count” value from your element and add 1 to it.
Demo


Problem with having a global counter as you have in var i = 0; it will no represent the button you have click, but all of them.

If you have better answer, please add a comment about this, thank you!

javascript jquery php
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Shopware 400 Status Error “This value is too long. It should have 255 character or less.” When I Try Updating Database Table

01/04/2023

Resolved: Using AWK to count multiple patterns in a file

01/04/2023

Resolved: significance letter above bar graphic in wrong order

01/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.