0
I have two inputs in each group with name
equal, where each one has values
different, whole and half
Using the if
and else
or otherwise, I would like to count the inputs that will be checked
.
- When I speak of
if
andelse
i imagine it would be a way to " If the button is checked add++; Otherwise --subtract;
As my knowledge is very shallow, I would love comments on the logic of such a function.
https://jsfiddle.net/he0fch08/
I left it for you to see more or less the idea. I commented on the last else
in javascript because this is already running too.
Example of the situation would be the following,
- Began the program
- Check the first input from
grupo[0]
. - See the result - Will appear 1 and 0.
- Selects the 2nd
grupo[0]
- There will be 0 and 1. - When I choose again
grupo[0]
, It was to be 1 and 0 again, but then the first mismatch happens - Appearing 1 and 1. - And so on to add to the choices of other inputs.
Man I don’t understand what you want to do.
– Caique Romero
The goal is to count how many half inputs are
checked
and how many inputs ofinteiro
arechecked
?– Isac
That’s right @Isac, I’m arranging the question and the example, I was very tired when I did it, it really got confused!
– Bender
@Caiqueromero, I’ll fix it, but that’s what Isac said, really the question I asked is very confusing.
– Bender