+ 1
Not getting the right event.
<span class='close-button ind${i}' onclick="toggleModal1(this)">Ă</span> The "i" value ranges from 0 to 27 and my toggleModal1 function goes like this: function toggleModal1(event) { console.log(event); } whenever I click the "x" with some class, ind{x}, I'm always getting the span with class ind0, why ?
3 Answers
+ 1
The most likely reason you are getting ind0 is that variable i is not incremented.
Show your code, you may get more community members to respond, increasing your chances of getting a better solution.
+ 1
Interesting, I wish I could see your code.
0
ODLNT , that's not the reason though . each span has a diff ind+x class.