You're trying to catch a pop-up event for the elements. Here, read it
. That was not such a problem, use what you suggested @Alvah_Ritchie68
in the second embodiment. The only thing is, there is a caveat, in the presence of several such logic elements may (remember that this is still js) to break, so best to check on the length of elements with this set of classes and each give a tracking event click. Well, or hang directly in the html onclick.
If the problem is still in a deep setting, I recommend to go back to the link to the article about pop-up events and the interception, they were at the beginning of this response. Or read how it is done by the means of jQuery, because, as I understand the syntax is it (not the fact, for the fashion at the record through $ went on it).