Here's the problem..
- Content is created with a forEach loop over an array of JSON results from an API
- Want content to appear as headings, and when user clicks on "more-info" that section is revealed.
- each repetition of the content may need a unique id so that the apropriate section can be revealed.
When using 'event.target' the click sometimes registers on the text inside the div and not on the whole section. If I add a specific listener then the click will bubble up to the parent and trigger the listener, but I can not create the listeners on the fly when adding the content as it seems to overide each listener with the next. So only the last one created is active once the content has finished loading.
I bet this is a really common thing to deal with but cant find a good answer. Help!!