How get each element of an Array?
I'm working on another developer's code. It's a project in Node.js and it has a page with some buttons that arrive via a route. For example, when information is entered in a form, it is displayed on this page with some buttons. The code made to display such buttons is in a forEach() method, and was written in the code only once, so I assume that it is forEach() that is generating individual buttons for each information entered in the form.
I created a function with the help of a friend on this forum (here) that inserts input of type checkbox for each of these buttons. My goal is that when the checkbox of that button I chose is clicked, only that button is disabled. What is happening is that only the b1 checkbox is triggering the function, and when it is triggered, the other checkboxes are also, but when I try to click on checkbox b2, b3... it doesn't work. I assume it's because of forEach(), what I need is to make this function work individually for each button, but I don't know how to do it using forEach().
JSFiddle with the example cited.
from Recent Questions - Stack Overflow https://ift.tt/2T6QUaa
https://ift.tt/35OHZgn

Comments
Post a Comment